Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Segmentation fault while adding a new addTransceiver() in Common.js #510

Closed
tesnorindian opened this issue Jun 2, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@tesnorindian
Copy link

Hi all,

I am trying to add a new screen video track for my KVSViewer. I made changes to the struct __SampleStreamingSession in Samples.h under the samples folder and made the corresponding changes in Common.js

screenTrack.kind = MEDIA_STREAM_TRACK_KIND_VIDEO;
screenTrack.codec = RTC_CODEC_H264_PROFILE_42E01F_LEVEL_ASYMMETRY_ALLOWED_PACKETIZATION_MODE;
STRCPY(screenTrack.streamId, "myKvsVideoStream");
STRCPY(screenTrack.trackId, "myScreenTrack");
CHK_STATUS(addTransceiver(pSampleStreamingSession->pPeerConnection,
&screenTrack,
NULL,
&pSampleStreamingSession->pScreenRtcRtpTransceiver));

CHK_STATUS(transceiverOnBandwidthEstimation(pSampleStreamingSession->pScreenRtcRtpTransceiver,
                   (UINT64) pSampleStreamingSession,
                   sampleBandwidthEstimationHandler));

I also added the corresponding transceiverOnFrame for the new transreceiver. But, when I run the KVSViewer I am getting Segmentation fault in populateSessionDescriptionDataChannel() of SessionDescription.c.

The back trace from gdb is as follows

#0 0x00007ffff7bb5db1 in populateSessionDescriptionDataChannel () at /home/ubuntu/amazon-kinesis-video-streams-webrtc-sdk-c/build/libkvsWebrtcClient.so
#1 0x00007ffff7bb60a6 in populateSessionDescriptionMedia () at /home/ubuntu/amazon-kinesis-video-streams-webrtc-sdk-c/build/libkvsWebrtcClient.so
#2 0x00007ffff7bb6191 in populateSessionDescription () at /home/ubuntu/amazon-kinesis-video-streams-webrtc-sdk-c/build/libkvsWebrtcClient.so
#3 0x00007ffff7bb14bb in createOffer () at /home/ubuntu/amazon-kinesis-video-streams-webrtc-sdk-c/build/libkvsWebrtcClient.so
#4 0x7262657720505443 in ()

The issue happens while creating the SDP offer to be sent to the master. I am clueless on why this is happening or may be I am missing something. Can anybody help me on how to resolve this or is this a bug in the SDK?

@tesnorindian
Copy link
Author

Hi all,

This line is causing the segmentation fault.

pSdpMediaDescription->mediaAttributesCount = attributeCount;

The pSdpMediaDescription is got from the pLocalSessionDescription which is initialized in the createOffer()

@MushMal
Copy link
Contributor

MushMal commented Jun 2, 2020

@MushMal MushMal added the bug Something isn't working label Jun 2, 2020
MushMal added a commit that referenced this issue Jun 3, 2020
…ansceivers, changing to heap allocation due to large on-stack structure, adding test to validate.

Issue: #510
@tesnorindian
Copy link
Author

Thanks @MushMal for the quick turnaround.

Meanwhile we have disabled SCTP in our offer to support an additional video track as we don't need application media line for our use case.

I will try with the new fix supporting up to 5 media lines.

Thanks once again.

@MushMal
Copy link
Contributor

MushMal commented Jun 4, 2020

I am resolving this issue for now. Please don’t hesitate to reopen

@MushMal MushMal closed this as completed Jun 4, 2020
MushMal added a commit that referenced this issue Jun 4, 2020
#515)

* Fixing a customer reported crash, adding capability to handle more transceivers, changing to heap allocation due to large on-stack structure, adding test to validate.

Issue: #510

* Fixing unit test and an edge case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants