After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796682 - Deadlock in webrtcbin on shutdown
Deadlock in webrtcbin on shutdown
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.14.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-26 15:34 UTC by Jan Schmidt
Modified: 2018-06-27 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log from GST_DEBUG=*:3,webrtc*:6,funnel:6 (57.25 KB, text/x-log)
2018-06-26 15:34 UTC, Jan Schmidt
  Details
Pipeline dump when deadlocked (68.72 KB, application/msword-template)
2018-06-26 15:35 UTC, Jan Schmidt
  Details
webrtc: Don't deadlock on block pads on shutdown (2.83 KB, patch)
2018-06-26 17:15 UTC, Jan Schmidt
accepted-commit_now Details | Review

Description Jan Schmidt 2018-06-26 15:34:27 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.
Comment 1 Jan Schmidt 2018-06-26 15:35:05 UTC
Created attachment 372833 [details]
Pipeline dump when deadlocked
Comment 2 Jan Schmidt 2018-06-26 17:15:29 UTC
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
Comment 3 Jan Schmidt 2018-06-26 17:15:56 UTC
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
Comment 4 Jan Schmidt 2018-06-26 17:44:24 UTC
btw, this seems caused by the lack of DTLS completion in bug #795166, but doesn't fix it.
Comment 5 Matthew Waters (ystreet00) 2018-06-27 02:28:31 UTC
Review of attachment 372835 [details] [review]:

Maybe add a comment to that effect?
Comment 6 Jan Schmidt 2018-06-27 14:50:10 UTC
Pushed to master and 1.14 as ed90d3b and 798a5d respectively