GNOME Bugzilla – Bug 796682
Deadlock in webrtcbin on shutdown
Last modified: 2018-06-27 14:50:10 UTC
Created attachment 372832 [details] log from GST_DEBUG=*:3,webrtc*:6,funnel:6 I am seeing a bug with git master where webrtcbin deadlocks in transportbin on shutdown, and it's very reproducable with Safari as the peer. It seems to be when DTLS negotiation doesn't complete, and therefore might be related to to bug #795166 Pad blocks on funnel seem to tie into it.
Created attachment 372833 [details] Pipeline dump when deadlocked
Removing the calls to gst_pad_set_active (..., FALSE); for the various potentially-blocked pads in transport_send_bin_change_state() removes the deadlock, but might lead to spurious bus errors when shutting down? It might be better to remove those calls, but also move the code that removes the pad blocks to after the parent change_state() has executed and presumably at that point shut down all child elements and prevented any accidental data flow. Proposed patch coming
Created attachment 372835 [details] [review] webrtc: Don't deadlock on block pads on shutdown When changing state downward, we can't set pads to inactive if they are blocked, it will deadlock trying to acquire the streaming lock. Just calling the parent state change function will do the correct things to unblock probes and set the pad inactive, so let it do that and remove the probes after the parent state change function has run
btw, this seems caused by the lack of DTLS completion in bug #795166, but doesn't fix it.
Review of attachment 372835 [details] [review]: Maybe add a comment to that effect?
Pushed to master and 1.14 as ed90d3b and 798a5d respectively