[Bug 656751] New: deadlock in decodebin2

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Aug 17 07:59:45 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=656751
  GStreamer | gst-plugins-base | git

           Summary: deadlock in decodebin2
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: youness.alaoui at collabora.co.uk
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


I'm working on HLS streaming and when I do a seek in an HLS stream, I can
trigger a deadlock in decodebin2. It's not easy to reproduce with GST_DEBUG
enabled, but I can reproduce it with enough tries (race condition).
Basically what happens is that tsdemux will switch streams by adding pads and
sending an EOS on the previous pads, this results in the deadlock where the eos
handlers (for audio and video) will get triggered.. one of them takes the
chain/group/expose lock and tries to remove the group/chain but blocks because
it tries to get the stream pad lock which has already been taken by the
gst_pad_send_event that is sending the EOS on the other thread, which itself is
blocked waiting for the chain lock taken by the first thread...

Have a look at the backtrace for the two threads involved :

Thread 8 (Thread 0x9e7feb70 (LWP 31178)):
#0  0x4da31232 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x4dbead22 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4dbe6897 in _L_lock_600 () from /lib/libpthread.so.0
#3  0x4dbe6784 in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x00c08276 in drain_and_switch_chains (chain=0xac80dc90,
drainpad=0xac81a200, last_group=0x9e7fda64, drained=0x9e7fda6c, switched=
    0x9e7fda68) at gstdecodebin2.c:2973
#5  0x00c0ac76 in gst_decode_pad_handle_eos (pad=0xac81a200) at
gstdecodebin2.c:3042
#6  source_pad_event_probe (dpad=0xac81a200, pad=0xac81a200, event=<optimized
out>) at gstdecodebin2.c:3570
#7  source_pad_event_probe (pad=0xac81a200, event=0xae8cccc0, dpad=0xac81a200)
at gstdecodebin2.c:3554
#8  0x004b2d62 in gst_marshal_BOOLEAN__POINTER (closure=0xae873f68,
return_value=0x9e7fdbd4, n_param_values=2, param_values=0x9e7fdca4, 
    invocation_hint=0x9e7fdbc0, marshal_data=0x0) at gstmarshal.c:586
#9  0x4ddda025 in g_closure_invoke () from /lib/libgobject-2.0.so.0
#10 0x4ddec3b0 in ?? () from /lib/libgobject-2.0.so.0
#11 0x4ddf4b0d in g_signal_emitv () from /lib/libgobject-2.0.so.0
#12 0x00429914 in gst_pad_emit_have_data_signal (pad=0xac81a200, obj=<optimized
out>) at gstpad.c:4144
#13 0x0046d5a9 in gst_pad_push_event (pad=0xac81a200, event=0xae8cccc0) at
gstpad.c:5237
#14 0x00453ed4 in gst_proxy_pad_event_default (pad=0xafe4b620,
event=0xae8cccc0) at gstghostpad.c:143
#15 0x0046d0f8 in gst_pad_send_event (pad=0xafe4b620, event=0xae8cccc0) at
gstpad.c:5399
#16 0x0046d708 in gst_pad_push_event (pad=0xae840268, event=0xae8cccc0) at
gstpad.c:5251
#17 0x0103eaee in gst_ffmpegdec_sink_event (pad=0xae8401a0, event=0xae8cccc0)
at gstffmpegdec.c:2444
#18 0x0046d0f8 in gst_pad_send_event (pad=0xae8401a0, event=0xae8cccc0) at
gstpad.c:5399
#19 0x0046d708 in gst_pad_push_event (pad=0xae8400d8, event=0xae8cccc0) at
gstpad.c:5251
#20 0x007eb240 in gst_single_queue_push_one (object=0xae8cccc0, sq=0xad6068b0,
mq=0xaf411000) at gstmultiqueue.c:1106
#21 gst_multi_queue_loop (pad=0xae8400d8) at gstmultiqueue.c:1314
#22 0x00496bfa in gst_task_func (task=0xad683948) at gsttask.c:243
#23 0x00498018 in default_func (tdata=0xaccffa98, pool=0x985ec08) at
gsttaskpool.c:70
#24 0x4dcdab07 in ?? () from /lib/libglib-2.0.so.0
#25 0x4dcd8535 in ?? () from /lib/libglib-2.0.so.0
#26 0x4dbe49fe in start_thread () from /lib/libpthread.so.0
#27 0x4db2b24e in clone () from /lib/libc.so.6


Thread 7 (Thread 0x9dffdb70 (LWP 31179)):
#0  0x4da31232 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x4dbead22 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4dbe6897 in _L_lock_600 () from /lib/libpthread.so.0
#3  0x4dbe6784 in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x4dcd89e5 in g_static_rec_mutex_lock () from /lib/libglib-2.0.so.0
#5  0x004628f3 in post_activate (pad=0xafe4b620, new_mode=<optimized out>) at
gstpad.c:657
#6  0x0046b267 in post_activate (new_mode=GST_ACTIVATE_NONE, pad=0xafe4b620) at
gstpad.c:650
#7  gst_pad_activate_push (pad=0xafe4b620, active=0) at gstpad.c:960
#8  0x00454945 in gst_ghost_pad_activate_push_default (pad=0xac81a200,
active=0) at gstghostpad.c:893
#9  0x0046b158 in gst_pad_activate_push (pad=0xac81a200, active=0) at
gstpad.c:953
#10 0x0046bef1 in gst_pad_set_active (pad=0xac81a200, active=0) at gstpad.c:715
#11 0x00c10c42 in pad_removed_cb (element=0xafe1d0d8, pad=0xac81a200,
decoder=0x9bb8168) at gsturidecodebin.c:1123
#12 0x4ddf69fb in g_cclosure_marshal_VOID__OBJECT () from
/lib/libgobject-2.0.so.0
#13 0x4ddda025 in g_closure_invoke () from /lib/libgobject-2.0.so.0
#14 0x4ddec3b0 in ?? () from /lib/libgobject-2.0.so.0
#15 0x4ddf5442 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
#16 0x4ddf55c4 in g_signal_emit () from /lib/libgobject-2.0.so.0
#17 0x0044898f in gst_element_remove_pad (element=0xafe1d0d8, pad=0xac81a200)
at gstelement.c:881
#18 0x00c07f07 in gst_decode_chain_free_internal (chain=0xac81cd18, hide=1) at
gstdecodebin2.c:2498
#19 0x00c07fe1 in gst_decode_group_free_internal (group=0xad60c540, hide=1) at
gstdecodebin2.c:2614
#20 0x00c0798c in gst_decode_chain_free_internal (chain=0xaf204ac8, hide=1) at
gstdecodebin2.c:2432
#21 0x00c07fe1 in gst_decode_group_free_internal (group=0xafe3ba50, hide=1) at
gstdecodebin2.c:2614
#22 0x00c08631 in gst_decode_group_hide (group=<optimized out>) at
gstdecodebin2.c:2687
#23 drain_and_switch_chains (chain=<optimized out>, drainpad=0xad61bed0,
last_group=0x9dffc824, drained=0x9dffc82c, switched=0x9dffc828)
    at gstdecodebin2.c:3002
#24 0x00c0ac76 in gst_decode_pad_handle_eos (pad=0xad61bed0) at
gstdecodebin2.c:3042
#25 source_pad_event_probe (dpad=0xad61bed0, pad=0xad61bed0, event=<optimized
out>) at gstdecodebin2.c:3570
#26 source_pad_event_probe (pad=0xad61bed0, event=0xae8cccf0, dpad=0xad61bed0)
at gstdecodebin2.c:3554
#27 0x004b2d62 in gst_marshal_BOOLEAN__POINTER (closure=0xad642f50,
return_value=0x9dffc994, n_param_values=2, param_values=0x9dffca64, 
    invocation_hint=0x9dffc980, marshal_data=0x0) at gstmarshal.c:586
#28 0x4ddda025 in g_closure_invoke () from /lib/libgobject-2.0.so.0
#29 0x4ddec3b0 in ?? () from /lib/libgobject-2.0.so.0
#30 0x4ddf4b0d in g_signal_emitv () from /lib/libgobject-2.0.so.0
#31 0x00429914 in gst_pad_emit_have_data_signal (pad=0xad61bed0, obj=<optimized
out>) at gstpad.c:4144
#32 0x0046d5a9 in gst_pad_push_event (pad=0xad61bed0, event=0xae8cccf0) at
gstpad.c:5237
#33 0x00453ed4 in gst_proxy_pad_event_default (pad=0xad61c6f8,
event=0xae8cccf0) at gstghostpad.c:143
#34 0x0046d0f8 in gst_pad_send_event (pad=0xad61c6f8, event=0xae8cccf0) at
gstpad.c:5399
#35 0x0046d708 in gst_pad_push_event (pad=0xae8eebf0, event=0xae8cccf0) at
gstpad.c:5251
#36 0x00587c00 in gst_faad_sink_event (pad=0xae8eeb28, event=<optimized out>)
at gstfaad.c:682
#37 0x0046d0f8 in gst_pad_send_event (pad=0xae8eeb28, event=0xae8cccf0) at
gstpad.c:5399
#38 0x0046d708 in gst_pad_push_event (pad=0xae840588, event=0xae8cccf0) at
gstpad.c:5251
---Type <return> to continue, or q <return> to quit---
#39 0x0046e30f in gst_pad_event_default_dispatch (event=0xae8cccf0,
pad=0xae8404c0) at gstpad.c:3556
#40 gst_pad_event_default (pad=0xae8404c0, event=0xae8cccf0) at gstpad.c:3640
#41 0x00d58599 in gst_base_parse_sink_event (pad=0xae8404c0, event=0xae8cccf0)
at gstbaseparse.c:889
#42 0x0046d0f8 in gst_pad_send_event (pad=0xae8404c0, event=0xae8cccf0) at
gstpad.c:5399
#43 0x0046d708 in gst_pad_push_event (pad=0xae8403f8, event=0xae8cccf0) at
gstpad.c:5251
#44 0x007eb240 in gst_single_queue_push_one (object=0xae8cccf0, sq=0xae8d4238,
mq=0xaf411000) at gstmultiqueue.c:1106
#45 gst_multi_queue_loop (pad=0xae8403f8) at gstmultiqueue.c:1314
#46 0x00496bfa in gst_task_func (task=0xad6839d0) at gsttask.c:243
#47 0x00498018 in default_func (tdata=0xac8057c8, pool=0x985ec08) at
gsttaskpool.c:70
#48 0x4dcdab07 in ?? () from /lib/libglib-2.0.so.0
#49 0x4dcd8535 in ?? () from /lib/libglib-2.0.so.0
#50 0x4dbe49fe in start_thread () from /lib/libpthread.so.0
#51 0x4db2b24e in clone () from /lib/libc.so.6

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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