GNOME Bugzilla – Bug 787878
adaptivedemux: Deadlock between Stream Pad and Manifest lock
Last modified: 2018-11-03 14:13:35 UTC
This deadlock happens fairly regularly whilst trying to play a variant HLS with multiple audio renditions (http://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8 in my case). One of the gst_adaptive_demux_stream_download_loop threads calls gst_pad_set_active with the manifest lock taken and that blocks waiting for GST_PAD_STREAM_LOCK. The other implicated thread has called into _src_chain of adaptivedemux with the Pad Stream lock taken and is waiting for the manifest lock. Deadlock ensues.
+ Trace 237981
Thread 26 (LWP 1536)
Thread 22 (LWP 1532)
Looking through adaptivedemux.c there are numerous places where gst_pad_set_active is called with the Manifest lock held, though in gst_adaptive_demux_expose_streams it appears to be deliberately dropped. However, gst_adaptive_demux_reset which has near identical code doesn't drop the Manifest lock. I'll work on a patch.
Created attachment 360123 [details] [review] Proposed patch As well as moving gst_pad_set_active calls outside of manifest locks there were a couple of missing manifest lock calls that caused other deadlocks.
Created attachment 360134 [details] [review] Proposed patch
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/611.