Closed Bug 1427577 Opened 6 years ago Closed 6 years ago

[webrtc] video_receive_ssrcs_ would be corrupted when firefox received more than 2 video streams which led firefox crashed

Categories

(Core :: WebRTC: Networking, defect)

57 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1479853

People

(Reporter: joezhu3, Unassigned)

References

Details

(Whiteboard: [needinfo reporter 2018-03-29] )

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171226083017

Steps to reproduce:

1) Three firefox  endpoints(let's say A/B/C) joined in the same meeting using bundle sdp
2) A&B send their own video stream,and C receives two video streams.seems to be good so far.
3) Then let C quit the conference ,and C crashes
The crash cause by  RTC_CHECK(receive_stream_impl != nullptr); which in Call.cc Line 692


Actual results:

Then let C quit the conference ,and C crashes.
The crash was caused by  RTC_CHECK(receive_stream_impl != nullptr); which in Call.cc Line 692 when call DestroyVideoReceiveStream.
I review the code ,there should be two recv streams in C when join in the meeting  but seems that firefox will call SetRemoteSSRC again which will modify recv stream in video_receive_ssrcs_ .and when C quit the meeting ,there is no corresponding recv stream,and it cause the RTC-check failed.


Expected results:

There should be no crash when more than 2 firefox join the meeting.
PS,if there more than 2 recv streams,firefox will recv 2 ssrcs in rtp packets ,and sometimes firefox maybe will misjudge that there is a SSRC change case ,so recall the setRemoteSSRC to recreate the recv stream
Component: Untriaged → WebRTC: Networking
Product: Firefox → Core
David, Thank you for your report! I wasn't able to reproduce your crash when I tried just now. I was wondering if you would mind trying to reproduce it again on your end and let me know if you still see it. If so, it would be helpful if you could let us know the service you were using (if any) when it crashed and if you could attach the log from about:webrtc to this bug. Thanks!
Flags: needinfo?(zhuzhenhao)
Whiteboard: [needinfo reporter 2018-01-17]
Dan,this case was not reproduced all the time but indeed it still happened at my side particular when C endpoint quit the meeting. 

I use unified plan(bundle peerconnection) to receive multistream in firefox means there are two video M lines in SDP.
When C join the meeting ,it will create two video streams which indicated by ssrs-A and ssrc-B when call .It is OK to construct this two receive streams using setRemoteDescription and storged ssrc informations in video_receive_ssrcs_ map(Call::CreateVideoReceiveStream).
The problem is that when firefox C begin to receive RTP data from A and B(WebrtcVideoConduit::ReceivedRTPPacket),basically one recv stream must receive only one ssrc stream (like ssrc-A or ssrc-B) but sometime  recv stream A will receive ssrc-B rtp data(I guess ) so firefox C think there is a ssrc change case happened ,and it delivered to main thread to update the video_receive_ssrcs_ map which will corrupted the video_receive_ssrcs_ map
when C quit the meeting ,it will call Call::DestroyVideoReceiveStream and RTC_CHECK(receive_stream_impl != nullptr) happened.
I dont know if I have descripted this case clearly。
Flags: needinfo?(zhuzhenhao)
Yes,this issue was related to ssrc switching and would likely re-create the VideoReceiveStream which corrupted the initial recv stream.
(In reply to david from comment #4)
> Yes,this issue was related to ssrc switching and would likely re-create the
> VideoReceiveStream which corrupted the initial recv stream.
with bundle sdp that use the same RTP session
See Also: → 1361624
Thanks for your information,Nils,So how can we deal with this problem next step?At least we don't want this RTC_CHECK failed for our products
Or do you have plans to solve this issue?
Actually it would be interesting if bug 1394602 fixes your issue. If you are up to it you can either download the try build binaries from that bug report your self, or I can provide the download links here so you can give it a try.
See Also: → 1394602
OK, Nils,could you kindly provide download links ?thanks
Whiteboard: [needinfo reporter 2018-01-17] → [needinfo reporter 2018-03-29]
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(joezhu3)
You need to log in before you can comment on or make changes to this bug.