[Bug 783777] New: Deadlock gstpad vs decodebin2
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Wed Jun 14 06:13:35 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=783777
Bug ID: 783777
Summary: Deadlock gstpad vs decodebin2
Classification: Platform
Product: GStreamer
Version: 1.8.3
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gst-plugins-base
Assignee: gstreamer-bugs at lists.freedesktop.org
Reporter: krzysztof.kapuscik at redembedded.com
QA Contact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
Created attachment 353730
--> https://bugzilla.gnome.org/attachment.cgi?id=353730&action=edit
Deadlock callstacks
During dash playback there is an error between pad posting an event (which goes
to decoebin2 on its pad) and decodebin2 trying to modify pad state.
>From the dump (attached):
Thread 21:
#4 0xb69db71a in post_activate (new_mode=GST_PAD_MODE_NONE, pad=0x9430c328) at
/usr/src/debug/gstreamer1.0/1.8.3-r0/gstreamer-1.8.3/gst/gstpad.c:1014
static void
post_activate (GstPad * pad, GstPadMode new_mode)
{
switch (new_mode) {
case GST_PAD_MODE_NONE:
/* ensures that streaming stops */
GST_PAD_STREAM_LOCK (pad); <====== Hangs here
#23 0xb60261ba in gst_decode_pad_handle_eos (pad=0x9563d9d0) at
/usr/src/debug/gstreamer1.0-plugins-base/1.8.3-r0/gst-plugins-base-1.8.3/gst/playback/gstdecodebin2.c:4156
static gboolean
gst_decode_pad_handle_eos (GstDecodePad * pad)
{
...
EXPOSE_LOCK (dbin); <====== Lock taken
if (dbin->decode_chain) {
drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained,
&switched);
--------------
Thread 17:
#3 0xb6026164 in gst_decode_pad_handle_eos (pad=0x9563d6c0) at
/usr/src/debug/gstreamer1.0-plugins-base/1.8.3-r0/gst-plugins-base-1.8.3/gst/playback/gstdecodebin2.c:4154
static gboolean
gst_decode_pad_handle_eos (GstDecodePad * pad)
{
....
GST_LOG_OBJECT (dbin, "pad %p", pad);
EXPOSE_LOCK (dbin); <========= Waits for lock here
#16 0xb69d6ab4 in gst_pad_send_event_unchecked (pad=pad at entry=0x9430c328,
event=event at entry=0x9430f930, type=<optimized out>,
type at entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at
/usr/src/debug/gstreamer1.0/1.8.3-r0/gstreamer-1.8.3/gst/gstpad.c:5587
/* lock order: STREAM_LOCK, LOCK, recheck flushing. */
GST_OBJECT_UNLOCK (pad);
GST_PAD_STREAM_LOCK (pad); <===== Lock taken here, as EOS event is
serialized
need_unlock = TRUE;
GST_OBJECT_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
if (G_UNLIKELY (GST_PAD_IS_EOS (pad)))
goto eos;
}
break;
}
/* now do the probe */
PROBE_PUSH (pad,
type | GST_PAD_PROBE_TYPE_PUSH |
GST_PAD_PROBE_TYPE_BLOCK, event, probe_stopped);
PROBE_PUSH (pad, type | GST_PAD_PROBE_TYPE_PUSH, event, probe_stopped);
eventfullfunc = GST_PAD_EVENTFULLFUNC (pad);
eventfunc = GST_PAD_EVENTFUNC (pad);
if (G_UNLIKELY (eventfunc == NULL && eventfullfunc == NULL))
goto no_function;
ACQUIRE_PARENT (pad, parent, no_parent);
GST_OBJECT_UNLOCK (pad);
ret = pre_eventfunc_check (pad, event); <= executes this
(gdb) print *event
$5 = {mini_object = {type = 3052471832, refcount = 54, lockstate = 0, flags =
0, copy = 0xb69c6751 <_gst_event_copy>, dispose = 0x0, free = 0xb69c68bd
<_gst_event_free>, n_qdata = 0, qdata = 0x0}, type = GST_EVENT_EOS, timestamp =
18446744073709551615, seqnum = 8629}
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list