[Bug 643087] New: pulsesink: deadlock in gst_pulseringbuffer_open_device

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Feb 23 08:29:01 PST 2011


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

           Summary: pulsesink: deadlock in gst_pulseringbuffer_open_device
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: philipj at opera.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
      GNOME target: ---
     GNOME version: ---


I'm using decodebin2 and creating audiosink when needed from the
"new-decoded-pad" signal callback. It happens quite often for me that there's a
deadlock when two pipelines do this simultaneously.

One thread is waiting in pulsesink.c:455: g_mutex_lock
(pa_shared_resource_mutex);

The other thread is waiting in pulsesink.c:511: pa_threaded_mainloop_wait
(mainloop). In other words this thread is holding pa_shared_resource_mutex,
which is taken further up in that function.

Here's the full backtrace of the two threads that have deadlocked using the git
master of all repos:

Thread 6 (Thread 0x7fffe6f5d700 (LWP 24602)):
#0  __lll_lock_wait () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1  0x00007ffff6f685b4 in _L_lock_990 () from /lib/libpthread.so.0
#2  0x00007ffff6f683ca in __pthread_mutex_lock (mutex=0x382fd30) at
pthread_mutex_lock.c:61
#3  0x00007fffde491e58 in gst_pulseringbuffer_open_device (buf=0x7fffe008c080)
at pulsesink.c:455
#4  0x00007fffef1940eb in gst_ring_buffer_open_device (buf=0x7fffe008c080) at
gstringbuffer.c:627
#5  0x00007fffef1a3c5e in gst_base_audio_sink_change_state (element=0x4f8f800,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstbaseaudiosink.c:1884
#6  0x00007fffde499d94 in gst_pulsesink_change_state (element=0x4f8f800,
transition=GST_STATE_CHANGE_NULL_TO_READY) at pulsesink.c:2749
#7  0x00007ffff01dc042 in gst_element_change_state (element=0x4f8f800,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#8  0x00007ffff01dbee9 in gst_element_set_state_func (element=0x4f8f800,
state=GST_STATE_READY) at gstelement.c:2614
#9  0x00007ffff01dbada in gst_element_set_state (element=0x4f8f800,
state=GST_STATE_READY) at gstelement.c:2515
#10 0x00007fffe4520b89 in gst_auto_audio_sink_find_best (sink=0x3938000) at
gstautoaudiosink.c:289
#11 0x00007fffe4521068 in gst_auto_audio_sink_detect (sink=0x3938000) at
gstautoaudiosink.c:343
#12 0x00007fffe45214e1 in gst_auto_audio_sink_change_state (element=0x3938000,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstautoaudiosink.c:391
#13 0x00007ffff01dc042 in gst_element_change_state (element=0x3938000,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#14 0x00007ffff01dbee9 in gst_element_set_state_func (element=0x3938000,
state=GST_STATE_READY) at gstelement.c:2614
#15 0x00007ffff01dbada in gst_element_set_state (element=0x3938000,
state=GST_STATE_READY) at gstelement.c:2515
#16 0x00007ffff01bf9c6 in gst_bin_element_set_state (bin=0x7fffe0081170,
element=0x3938000, base_time=0, start_time=0, current=GST_STATE_NULL,
next=GST_STATE_READY) at gstbin.c:2193
#17 0x00007ffff01c11bb in gst_bin_change_state_func (element=0x7fffe0081170,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstbin.c:2492
#18 0x00007ffff01dc042 in gst_element_change_state (element=0x7fffe0081170,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#19 0x00007ffff01dbee9 in gst_element_set_state_func (element=0x7fffe0081170,
state=GST_STATE_PAUSED) at gstelement.c:2614
#20 0x00007ffff01dbada in gst_element_set_state (element=0x7fffe0081170,
state=GST_STATE_PAUSED) at gstelement.c:2515
#21 0x000000000239e5bd in gst_op_link_pad (pipeline=0x4e14030,
srcpad=0x37c5620, binname=0x3085661 "opaudiobin", binfunc=0x239ea4b
<gst_op_audio_bin_new()>) at
../platforms/media_backends/gst/gstmediaplayer.cpp:1130
#22 0x000000000239dd98 in GstMediaPlayer::NewDecodedPad (decodebin=0x4e18100,
pad=0x37c5620, last=1, data=0x4e11ba0) at
../platforms/media_backends/gst/gstmediaplayer.cpp:958
#23 0x00007fffeeb41100 in gst_play_marshal_VOID__OBJECT_BOOLEAN
(closure=0x4e17c50, return_value=0x0, n_param_values=3,
param_values=0x7fffe0080050, invocation_hint=0x7fffe6f5c3d0, marshal_data=0x0)
at gstplay-marshal.c:209
#24 0x00007ffff06ae7fc in g_closure_invoke (closure=0x4e17c50,
return_value=0x0, n_param_values=3, param_values=0x7fffe0080050,
invocation_hint=0x7fffe6f5c3d0) at
/build/buildd/glib2.0-2.28.1/./gobject/gclosure.c:767
#25 0x00007ffff06c0019 in signal_emit_unlocked_R (node=<value optimized out>,
detail=0, instance=0x4e18100, emission_return=0x0,
instance_and_params=0x7fffe0080050) at
/build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:3252
#26 0x00007ffff06c9258 in g_signal_emit_valist (instance=<value optimized out>,
signal_id=<value optimized out>, detail=<value optimized out>, var_args=<value
optimized out>) at /build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:2983
#27 0x00007ffff06c941f in g_signal_emit (instance=<value optimized out>,
signal_id=<value optimized out>, detail=<value optimized out>) at
/build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:3040
#28 0x00007fffeeb389b0 in gst_decode_bin_expose (dbin=0x4e18100) at
gstdecodebin2.c:3256
#29 0x00007fffeeb38fd5 in source_pad_blocked_cb (pad=0x38aedb0, blocked=1,
dpad=0x37c5260) at gstdecodebin2.c:3384
#30 0x00007ffff01ff3fa in handle_pad_block (pad=0x38aedb0) at gstpad.c:4034
#31 0x00007ffff02028b5 in gst_pad_push_event (pad=0x38aedb0, event=0x37d5840)
at gstpad.c:5205
#32 0x00007fffec40ca5c in theora_handle_type_packet (dec=0x3916170,
packet=0x7fffe6f5ca80) at gsttheoradec.c:925
#33 0x00007fffec40cbdd in theora_handle_header_packet (dec=0x3916170,
packet=0x7fffe6f5ca80) at gsttheoradec.c:956
#34 0x00007fffec40e902 in theora_dec_decode_buffer (dec=0x3916170,
buf=0x38eb2c0) at gsttheoradec.c:1298
#35 0x00007fffec40ee15 in theora_dec_chain_forward (dec=0x3916170, discont=0,
buffer=0x38eb2c0) at gsttheoradec.c:1464
#36 0x00007fffec40ef20 in theora_dec_chain (pad=0x38aec30, buf=0x38eb2c0) at
gsttheoradec.c:1492
#37 0x00007ffff0201034 in gst_pad_push (pad=0x38aeab0, buffer=0x38eb2c0) at
gstpad.c:4667
#38 0x00007fffee6d4844 in gst_single_queue_push_one (mq=0x37e3000,
sq=0x37ea8d0, object=0x38eb2c0) at gstmultiqueue.c:921
#39 0x00007fffee6d4f76 in gst_multi_queue_loop (pad=0x38aeab0) at
gstmultiqueue.c:1101
#40 0x00007ffff023144f in gst_task_func (task=0x37cbc40) at gsttask.c:318
#41 0x00007ffff02325a2 in default_func (tdata=0x4d52a50, pool=0x4c6d000) at
gsttaskpool.c:70
#42 0x00007ffff0b99ac6 in g_thread_pool_thread_proxy (data=<value optimized
out>) at /build/buildd/glib2.0-2.28.1/./glib/gthreadpool.c:319
#43 0x00007ffff0b97394 in g_thread_create_proxy (data=0x37eb460) at
/build/buildd/glib2.0-2.28.1/./glib/gthread.c:1897
#44 0x00007ffff6f65d8c in start_thread (arg=0x7fffe6f5d700) at
pthread_create.c:304
#45 0x00007ffff651017d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#46 0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7fffe5a8c700 (LWP 24604)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:140
#1  0x00007ffff57f6900 in pa_threaded_mainloop_wait () from
/usr/lib/libpulse.so.0
#2  0x00007fffde492213 in gst_pulseringbuffer_open_device (buf=0x7fffe800f900)
at pulsesink.c:511
#3  0x00007fffef1940eb in gst_ring_buffer_open_device (buf=0x7fffe800f900) at
gstringbuffer.c:627
#4  0x00007fffef1a3c5e in gst_base_audio_sink_change_state
(element=0x7fffe805b680, transition=GST_STATE_CHANGE_NULL_TO_READY) at
gstbaseaudiosink.c:1884
#5  0x00007fffde499d94 in gst_pulsesink_change_state (element=0x7fffe805b680,
transition=GST_STATE_CHANGE_NULL_TO_READY) at pulsesink.c:2749
#6  0x00007ffff01dc042 in gst_element_change_state (element=0x7fffe805b680,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#7  0x00007ffff01dbee9 in gst_element_set_state_func (element=0x7fffe805b680,
state=GST_STATE_READY) at gstelement.c:2614
#8  0x00007ffff01dbada in gst_element_set_state (element=0x7fffe805b680,
state=GST_STATE_READY) at gstelement.c:2515
#9  0x00007fffe4520b89 in gst_auto_audio_sink_find_best (sink=0x3938640) at
gstautoaudiosink.c:289
#10 0x00007fffe4521068 in gst_auto_audio_sink_detect (sink=0x3938640) at
gstautoaudiosink.c:343
#11 0x00007fffe45214e1 in gst_auto_audio_sink_change_state (element=0x3938640,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstautoaudiosink.c:391
#12 0x00007ffff01dc042 in gst_element_change_state (element=0x3938640,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#13 0x00007ffff01dbee9 in gst_element_set_state_func (element=0x3938640,
state=GST_STATE_READY) at gstelement.c:2614
#14 0x00007ffff01dbada in gst_element_set_state (element=0x3938640,
state=GST_STATE_READY) at gstelement.c:2515
#15 0x00007ffff01bf9c6 in gst_bin_element_set_state (bin=0x7fffe0081730,
element=0x3938640, base_time=0, start_time=0, current=GST_STATE_NULL,
next=GST_STATE_READY) at gstbin.c:2193
#16 0x00007ffff01c11bb in gst_bin_change_state_func (element=0x7fffe0081730,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstbin.c:2492
#17 0x00007ffff01dc042 in gst_element_change_state (element=0x7fffe0081730,
transition=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2658
#18 0x00007ffff01dbee9 in gst_element_set_state_func (element=0x7fffe0081730,
state=GST_STATE_PAUSED) at gstelement.c:2614
#19 0x00007ffff01dbada in gst_element_set_state (element=0x7fffe0081730,
state=GST_STATE_PAUSED) at gstelement.c:2515
#20 0x000000000239e5bd in gst_op_link_pad (pipeline=0x4e14200,
srcpad=0x37c5da0, binname=0x3085661 "opaudiobin", binfunc=0x239ea4b
<gst_op_audio_bin_new()>) at
../platforms/media_backends/gst/gstmediaplayer.cpp:1130
#21 0x000000000239dd98 in GstMediaPlayer::NewDecodedPad (decodebin=0x4e18320,
pad=0x37c5da0, last=1, data=0x4e78eb0) at
../platforms/media_backends/gst/gstmediaplayer.cpp:958
#22 0x00007fffeeb41100 in gst_play_marshal_VOID__OBJECT_BOOLEAN
(closure=0x4e7b640, return_value=0x0, n_param_values=3,
param_values=0x7fffe00806d0, invocation_hint=0x7fffe5a8b3d0, marshal_data=0x0)
at gstplay-marshal.c:209
#23 0x00007ffff06ae7fc in g_closure_invoke (closure=0x4e7b640,
return_value=0x0, n_param_values=3, param_values=0x7fffe00806d0,
invocation_hint=0x7fffe5a8b3d0) at
/build/buildd/glib2.0-2.28.1/./gobject/gclosure.c:767
#24 0x00007ffff06c0019 in signal_emit_unlocked_R (node=<value optimized out>,
detail=0, instance=0x4e18320, emission_return=0x0,
instance_and_params=0x7fffe00806d0) at
/build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:3252
#25 0x00007ffff06c9258 in g_signal_emit_valist (instance=<value optimized out>,
signal_id=<value optimized out>, detail=<value optimized out>, var_args=<value
optimized out>) at /build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:2983
#26 0x00007ffff06c941f in g_signal_emit (instance=<value optimized out>,
signal_id=<value optimized out>, detail=<value optimized out>) at
/build/buildd/glib2.0-2.28.1/./gobject/gsignal.c:3040
#27 0x00007fffeeb389b0 in gst_decode_bin_expose (dbin=0x4e18320) at
gstdecodebin2.c:3256
#28 0x00007fffeeb38fd5 in source_pad_blocked_cb (pad=0x3895ad0, blocked=1,
dpad=0x37c59e0) at gstdecodebin2.c:3384
#29 0x00007ffff01ff3fa in handle_pad_block (pad=0x3895ad0) at gstpad.c:4034
#30 0x00007ffff02028b5 in gst_pad_push_event (pad=0x3895ad0, event=0x37dad80)
at gstpad.c:5205
#31 0x00007fffec40ca5c in theora_handle_type_packet (dec=0x3916b70,
packet=0x7fffe5a8ba80) at gsttheoradec.c:925
#32 0x00007fffec40cbdd in theora_handle_header_packet (dec=0x3916b70,
packet=0x7fffe5a8ba80) at gsttheoradec.c:956
#33 0x00007fffec40e902 in theora_dec_decode_buffer (dec=0x3916b70,
buf=0x38eb140) at gsttheoradec.c:1298
#34 0x00007fffec40ee15 in theora_dec_chain_forward (dec=0x3916b70, discont=0,
buffer=0x38eb140) at gsttheoradec.c:1464
#35 0x00007fffec40ef20 in theora_dec_chain (pad=0x3895950, buf=0x38eb140) at
gsttheoradec.c:1492
#36 0x00007ffff0201034 in gst_pad_push (pad=0x38957d0, buffer=0x38eb140) at
gstpad.c:4667
#37 0x00007fffee6d4844 in gst_single_queue_push_one (mq=0x37e3540,
sq=0x7fffe800e240, object=0x38eb140) at gstmultiqueue.c:921
#38 0x00007fffee6d4f76 in gst_multi_queue_loop (pad=0x38957d0) at
gstmultiqueue.c:1101
#39 0x00007ffff023144f in gst_task_func (task=0x37c6390) at gsttask.c:318
#40 0x00007ffff02325a2 in default_func (tdata=0x4d59a90, pool=0x4c6d000) at
gsttaskpool.c:70
#41 0x00007ffff0b99ac6 in g_thread_pool_thread_proxy (data=<value optimized
out>) at /build/buildd/glib2.0-2.28.1/./glib/gthreadpool.c:319
#42 0x00007ffff0b97394 in g_thread_create_proxy (data=0x7fffe800bd50) at
/build/buildd/glib2.0-2.28.1/./glib/gthread.c:1897
#43 0x00007ffff6f65d8c in start_thread (arg=0x7fffe5a8c700) at
pthread_create.c:304
#44 0x00007ffff651017d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#45 0x0000000000000000 in ?? ()

-- 
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