versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.26k stars 1.13k forks source link

Crash when `updateProducer` client request #156

Closed ibc closed 7 years ago

ibc commented 7 years ago
mediasoup-worker's stderr: ABORT[id:syvznrpk#3] RTC::Consumer::AddProfile() | failed assertion `this->profiles.find(profile) == this->profiles.end()': profile already exists

To reproduce in the demo:

CLIENT.changeWebcam(); // or changeWebcamResolution();
ibc commented 7 years ago

Some comments:

jmillan commented 7 years ago

Regarding to the comments above, it should already happen that way. Producer::ClearStreams is responsible for that, which is called by Producer::UpdateRtpParameters()

I've submitted a bugfix without which a crash with the following stack trace would occur:

mediasoup-worker              > 0x000000010d1c1d11 RTC::RtpStreamRecv::RequestKeyFrame() + 75 (memory:2397)
mediasoup-worker              > 0x000000010d1aef6e RTC::Producer::RequestKeyFrame(bool) + 290 (__tree:179)
mediasoup-worker              > 0x000000010d1b9bb7 RTC::Router::OnConsumerKeyFrameRequired(RTC::Consumer*) + 71 (Router.cpp:1767)
mediasoup-worker              > 0x000000010d19e9b4 RTC::Consumer::RequestKeyFrame() + 66 (Consumer.cpp:748)
mediasoup-worker              > 0x000000010d19f45b RTC::Consumer::RemoveProfile(RTC::RtpEncodingParameters::Profile) + 535 (Consumer.cpp:346)
mediasoup-worker              > 0x000000010d1b9a65 RTC::Router::OnProducerProfileDisabled(RTC::Producer*, RTC::RtpEncodingParameters::Profile) + 89
mediasoup-worker              > 0x000000010d1ae235 RTC::Producer::ClearRtpStreams() + 221 (Producer.cpp:607)
mediasoup-worker              > 0x000000010d1aecd5 RTC::Producer::UpdateRtpParameters(RTC::RtpParameters&) + 153
mediasoup-worker              > 0x000000010d1b454f RTC::Router::HandleRequest(Channel::Request*) + 5757 (Router.cpp:1021)
jmillan commented 7 years ago

I haven't reproduced the originally reported issue though. The one mentioned above was represented while trying it.