[Bug 652562] basesink: stuck in GST_PAD_PREROLL_WAIT

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jun 14 08:15:53 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=652562
  GStreamer | gstreamer (core) | git

--- Comment #6 from Philip Jägenstedt <philipj at opera.com> 2011-06-14 15:15:46 UTC ---
In such a case, it's gst_base_sink_change_state that calls
GST_PAD_PREROLL_SIGNAL for GST_STATE_CHANGE_PAUSED_TO_PLAYING, as such:

        if (basesink->eos) {
          GstMessage *message;

          /* need to post EOS message here */
          GST_DEBUG_OBJECT (basesink, "Now posting EOS");
          message = gst_message_new_eos (GST_OBJECT_CAST (basesink));
          gst_message_set_seqnum (message, basesink->priv->seqnum);
          gst_element_post_message (GST_ELEMENT_CAST (basesink), message);
        } else {
          GST_DEBUG_OBJECT (basesink, "signal preroll");
          GST_PAD_PREROLL_SIGNAL (basesink->sinkpad);
        }

Note especially that GST_PAD_PREROLL_SIGNAL is called only if basesink->eos is
not set. When the bug reproduces it is when the eos event has been posted, so
it seems quite likely that there's a relation. In such a case,
GST_PAD_PREROLL_SIGNAL would never be called here, so the other thread will be
left hanging in GST_PAD_PREROLL_WAIT.

Looking at the state of things in a normal (non-hanging) case, it appears as
though there may be some missing locking/synchronization for
sink->need_preroll. Thread 9 and 14 are the interesting ones, see backtrace at
bottom.

Thread 9 checked if (G_LIKELY (sink->need_preroll)) before going into
gst_base_sink_wait_preroll, but thread 14 sets basesink->need_preroll = FALSE
without making any strong guarantee that those waiting for preroll will be
notified in the case if (basesink->eos). Is the assumption that if we have
basesink->eos, then no thread can possibly be waiting for preroll? That seems
to not be a correct assumption, and possibly the root cause here.

(gdb) thread apply all bt

Thread 15 (Thread 0x7fffec427700 (LWP 17196)):
#0  0x00007ffff6058f03 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff3d1732f in ?? () from /usr/lib/libpulse.so.0
#2  0x00007ffff3d09116 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#3  0x00007ffff3d09749 in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#4  0x00007ffff3d09800 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#5  0x00007ffff3d172df in ?? () from /usr/lib/libpulse.so.0
#6  0x00007ffff308da88 in ?? () from /usr/lib/libpulsecommon-0.9.22.so
#7  0x00007ffff6aa9d8c in start_thread () from
/lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007ffff606604d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 14 (Thread 0x7fffeae2c700 (LWP 17195)):
#0  gst_base_sink_change_state (element=0x7fffd8026e90,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstbasesink.c:5006
#1  0x00007fffed12b919 in gst_base_audio_sink_change_state
(element=0x7fffd8026e90, transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at
gstbaseaudiosink.c:2016
#2  0x00007fffe9750dcf in gst_pulsesink_change_state (element=0x7fffd8026e90,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at pulsesink.c:2751
#3  0x00007fffee17a3e8 in gst_element_change_state (element=0x7fffd8026e90,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstelement.c:2728
#4  0x00007fffee17a28f in gst_element_set_state_func (element=0x7fffd8026e90,
state=GST_STATE_PLAYING) at gstelement.c:2684
#5  0x00007fffee179e80 in gst_element_set_state (element=0x7fffd8026e90,
state=GST_STATE_PLAYING) at gstelement.c:2585
#6  0x00007fffee15d9db in gst_bin_element_set_state (bin=0x3db8e20,
element=0x7fffd8026e90, base_time=0, start_time=0, current=GST_STATE_PAUSED,
next=GST_STATE_PLAYING) at gstbin.c:2209
#7  0x00007fffee15ef1f in gst_bin_change_state_func (element=0x3db8e20,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstbin.c:2518
#8  0x00007fffea1c255f in gst_auto_audio_sink_change_state (element=0x3db8e20,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstautoaudiosink.c:398
#9  0x00007fffee17a3e8 in gst_element_change_state (element=0x3db8e20,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstelement.c:2728
#10 0x00007fffee17a28f in gst_element_set_state_func (element=0x3db8e20,
state=GST_STATE_PLAYING) at gstelement.c:2684
#11 0x00007fffee179e80 in gst_element_set_state (element=0x3db8e20,
state=GST_STATE_PLAYING) at gstelement.c:2585
#12 0x00007fffee15d9db in gst_bin_element_set_state (bin=0x3db7170,
element=0x3db8e20, base_time=0, start_time=0, current=GST_STATE_PAUSED,
next=GST_STATE_PLAYING) at gstbin.c:2209
#13 0x00007fffee15ef1f in gst_bin_change_state_func (element=0x3db7170,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstbin.c:2518
#14 0x00007fffee17a3e8 in gst_element_change_state (element=0x3db7170,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstelement.c:2728
#15 0x00007fffee17a28f in gst_element_set_state_func (element=0x3db7170,
state=GST_STATE_PLAYING) at gstelement.c:2684
#16 0x00007fffee179e80 in gst_element_set_state (element=0x3db7170,
state=GST_STATE_PLAYING) at gstelement.c:2585
#17 0x00007fffee15d9db in gst_bin_element_set_state (bin=0x3d885d0,
element=0x3db7170, base_time=0, start_time=0, current=GST_STATE_PAUSED,
next=GST_STATE_PLAYING) at gstbin.c:2209
#18 0x00007fffee15ef1f in gst_bin_change_state_func (element=0x3d885d0,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstbin.c:2518
#19 0x00007fffee1a609c in gst_pipeline_change_state (element=0x3d885d0,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstpipeline.c:482
#20 0x00007fffee17a3e8 in gst_element_change_state (element=0x3d885d0,
transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstelement.c:2728
#21 0x00007fffee17a28f in gst_element_set_state_func (element=0x3d885d0,
state=GST_STATE_PLAYING) at gstelement.c:2684
#22 0x00007fffee179e80 in gst_element_set_state (element=0x3d885d0,
state=GST_STATE_PLAYING) at gstelement.c:2585
#23 0x000000000266bc55 in GstMediaPlayer::ThreadFunc (data=0x4e18cb0) at
../platforms/media_backends/gst/gstmediaplayer.cpp:290
#24 0x00007fffeedbb3e4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff6aa9d8c in start_thread () from
/lib/x86_64-linux-gnu/libpthread.so.0
#26 0x00007ffff606604d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#27 0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7fffe973d700 (LWP 17116)):
#0  0x00007ffff6aaebac in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fffed77e48a in gst_base_sink_wait_preroll (sink=0x7fffd8026e90) at
gstbasesink.c:2268
#2  0x00007fffed77e7dc in gst_base_sink_do_preroll (sink=0x7fffd8026e90,
obj=0x7fffe5223b00) at gstbasesink.c:2345
#3  0x00007fffed77f00e in gst_base_sink_do_sync (basesink=0x7fffd8026e90,
pad=0x7fffd823a640, obj=0x7fffe5223b00, late=0x7fffe973be48,
step_end=0x7fffe973be44, obj_type=2 '\002') at gstbasesink.c:2531
#4  0x00007fffed781e55 in gst_base_sink_render_object (basesink=0x7fffd8026e90,
pad=0x7fffd823a640, obj_type=2 '\002', obj=0x7fffe5223b00) at
gstbasesink.c:2976
#5  0x00007fffed7833ac in gst_base_sink_queue_object_unlocked
(basesink=0x7fffd8026e90, pad=0x7fffd823a640, obj_type=2 '\002',
obj=0x7fffe5223b00, prerollable=1) at gstbasesink.c:3293
#6  0x00007fffed7845a2 in gst_base_sink_chain_unlocked
(basesink=0x7fffd8026e90, pad=0x7fffd823a640, obj_type=2 '\002',
obj=0x7fffe5223b00) at gstbasesink.c:3672
#7  0x00007fffed784733 in gst_base_sink_chain_main (basesink=0x7fffd8026e90,
pad=0x7fffd823a640, obj_type=2 '\002', obj=0x7fffe5223b00) at
gstbasesink.c:3710
#8  0x00007fffed7848bc in gst_base_sink_chain (pad=0x7fffd823a640,
buf=0x7fffe5223b00) at gstbasesink.c:3739
#9  0x00007fffee19f2da in gst_pad_chain_data_unchecked (pad=0x7fffd823a640,
is_buffer=1, data=0x7fffe5223b00, cache=0x7fffe973c1f0) at gstpad.c:4248
#10 0x00007fffee19ff64 in gst_pad_push_data (pad=0x3c50870, is_buffer=1,
data=0x7fffe5223b00, cache=0x7fffe973c1f0) at gstpad.c:4480
#11 0x00007fffee1a0912 in gst_pad_push (pad=0x3c50870, buffer=0x7fffe5223b00)
at gstpad.c:4705
#12 0x00007fffee1826b8 in gst_proxy_pad_chain_default (pad=0x44041c0,
buffer=0x7fffe5223b00) at gstghostpad.c:272
#13 0x00007fffee19f2da in gst_pad_chain_data_unchecked (pad=0x44041c0,
is_buffer=1, data=0x7fffe5223b00, cache=0x7fffe973c440) at gstpad.c:4248
#14 0x00007fffee19ff64 in gst_pad_push_data (pad=0x3db5910, is_buffer=1,
data=0x7fffe5223b00, cache=0x7fffe973c440) at gstpad.c:4480
#15 0x00007fffee1a0912 in gst_pad_push (pad=0x3db5910, buffer=0x7fffe5223b00)
at gstpad.c:4705
#16 0x00007fffed79a77f in gst_base_transform_chain (pad=0x3db5310,
buffer=0x7fffe5223b00) at gstbasetransform.c:2474
#17 0x00007fffee19f2da in gst_pad_chain_data_unchecked (pad=0x3db5310,
is_buffer=1, data=0x7fffe5223b00, cache=0x7fffe973c690) at gstpad.c:4248
#18 0x00007fffee19ff64 in gst_pad_push_data (pad=0x3db5a90, is_buffer=1,
data=0x7fffe5223b00, cache=0x7fffe973c690) at gstpad.c:4480
#19 0x00007fffee1a0912 in gst_pad_push (pad=0x3db5a90, buffer=0x7fffe5223b00)
at gstpad.c:4705
#20 0x00007fffed79a77f in gst_base_transform_chain (pad=0x3db5610,
buffer=0x7fffe5223b00) at gstbasetransform.c:2474
#21 0x00007fffee19f2da in gst_pad_chain_data_unchecked (pad=0x3db5610,
is_buffer=1, data=0x7fffe5223b00, cache=0x7fffe973c8e0) at gstpad.c:4248
#22 0x00007fffee19ff64 in gst_pad_push_data (pad=0x3d8a4a0, is_buffer=1,
data=0x7fffe5223b00, cache=0x7fffe973c8e0) at gstpad.c:4480
#23 0x00007fffee1a0912 in gst_pad_push (pad=0x3d8a4a0, buffer=0x7fffe5223b00)
at gstpad.c:4705
#24 0x00007fffed79a77f in gst_base_transform_chain (pad=0x3d8a020,
buffer=0x7fffe5223b00) at gstbasetransform.c:2474
#25 0x00007fffee19f2da in gst_pad_chain_data_unchecked (pad=0x3d8a020,
is_buffer=1, data=0x7fffe5223b00, cache=0x7fffe973cb30) at gstpad.c:4248
#26 0x00007fffee19ff64 in gst_pad_push_data (pad=0x7fffd823a4c0, is_buffer=1,
data=0x7fffe5223b00, cache=0x7fffe973cb30) at gstpad.c:4480
#27 0x00007fffee1a0912 in gst_pad_push (pad=0x7fffd823a4c0,
buffer=0x7fffe5223b00) at gstpad.c:4705
#28 0x00007fffec65bfcd in gst_queue_push_one (queue=0x3b20300) at
gstqueue.c:1155
#29 0x00007fffec65cb28 in gst_queue_loop (pad=0x7fffd823a4c0) at
gstqueue.c:1263
#30 0x00007fffee1d14f3 in gst_task_func (task=0x3c56310) at gsttask.c:318
#31 0x00007fffee1d2646 in default_func (tdata=0x51ec380, pool=0x3baa800) at
gsttaskpool.c:70
#32 0x00007fffeedbdb16 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007fffeedbb3e4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff6aa9d8c in start_thread () from
/lib/x86_64-linux-gnu/libpthread.so.0
#35 0x00007ffff606604d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#36 0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7fffe8eec700 (LWP 17114)):
#0  0x00007ffff6aaebac in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fffee1d1440 in gst_task_func (task=0x3c56810) at gsttask.c:303
#2  0x00007fffee1d2646 in default_func (tdata=0x3f89e40, pool=0x3baa800) at
gsttaskpool.c:70
#3  0x00007fffeedbdb16 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fffeedbb3e4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6aa9d8c in start_thread () from
/lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff606604d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  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