[Bug 667562] New: [0.11] Race condition between streaming thread and resetting pads in downwards state change

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jan 9 06:40:14 PST 2012


https://bugzilla.gnome.org/show_bug.cgi?id=667562
  GStreamer | gstreamer (core) | 0.11.x

           Summary: [0.11] Race condition between streaming thread and
                    resetting pads in downwards state change
    Classification: Platform
           Product: GStreamer
           Version: 0.11.x
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: slomo at circular-chaos.org
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Happens when stopping playback by setting state to READY, for example with the
audio decoder base class:


** CRITICAL **: gst_audio_decoder_finish_frame: assertion `buf == NULL ||
gst_pad_has_current_caps (dec->srcpad)' failed
aborting...



(gdb) bt
#0  0x00007ffff4bfd405 in *__GI_raise (sig=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff4c00680 in *__GI_abort () at abort.c:92
#2  0x00007ffff543b32a in g_logv (log_domain=0x0, log_level=<optimized out>, 
    format=0x7ffff5481f88 "%s: assertion `%s' failed", args1=0x7fffe548d470)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmessages.c:557
#3  0x00007ffff543b3b3 in g_log (log_domain=<optimized out>, 
    log_level=<optimized out>, format=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmessages.c:577
#4  0x00007fffef438c89 in gst_audio_decoder_finish_frame (dec=0x653000, 
    buf=0xb526d0, frames=1) at gstaudiodecoder.c:785
#5  0x00007fffe4a86ce3 in vorbis_handle_data_packet (packet=0x7fffe548d650, 
    vd=0x653000, timestamp=<optimized out>, duration=<optimized out>)
    at gstvorbisdec.c:592
#6  vorbis_dec_handle_frame (dec=<optimized out>, buffer=0xb528f0)
    at gstvorbisdec.c:678
#7  0x00007fffef4354e8 in gst_audio_decoder_handle_frame (buffer=0xb528f0, 
    dec=0x653000, klass=<optimized out>) at gstaudiodecoder.c:972
#8  gst_audio_decoder_push_buffers (dec=0x653000, force=0)
    at gstaudiodecoder.c:1061
#9  0x00007fffef4358db in gst_audio_decoder_chain_forward (dec=0x653000, 
    buffer=0x0) at gstaudiodecoder.c:1163
---Type <return> to continue, or q <return> to quit---
#10 0x00007fffef435fdc in gst_audio_decoder_flush_decode (dec=0x653000)
    at gstaudiodecoder.c:1274
#11 gst_audio_decoder_chain_reverse (dec=0x653000, buf=0x0)
    at gstaudiodecoder.c:1354
#12 0x00007fffef43694b in gst_audio_decoder_drain (dec=0x653000)
    at gstaudiodecoder.c:1096
#13 0x00007fffef435d14 in gst_audio_decoder_flush (dec=0x653000, hard=0)
    at gstaudiodecoder.c:1128
#14 0x00007fffef437e48 in gst_audio_decoder_chain (pad=<optimized out>, 
    parent=<optimized out>, buffer=0xa30ab0) at gstaudiodecoder.c:1394
#15 0x00007ffff7935eba in gst_pad_chain_data_unchecked (data=0xa30ab0, 
    type=<optimized out>, pad=0x980620) at gstpad.c:3306
#16 gst_pad_push_data (pad=0x980420, type=<optimized out>, 
    data=<optimized out>) at gstpad.c:3509
#17 0x00007fffeebafbee in gst_single_queue_push_one (object=0xa30ab0, 
    sq=0x654e00, mq=0x84edd0) at gstmultiqueue.c:1056
#18 gst_multi_queue_loop (pad=<optimized out>) at gstmultiqueue.c:1287
#19 0x00007ffff7963c80 in gst_task_func (task=0x958240) at gsttask.c:322
#20 0x00007ffff545c3e4 in g_thread_pool_thread_proxy (data=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthreadpool.c:319
#21 0x00007ffff5459cf6 in g_thread_create_proxy (data=0x961330)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) thread apply all bt

Thread 6 (Thread 0x7fffdfdf8700 (LWP 7054)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:216
#1  0x00007ffff58e8452 in g_cond_timed_wait_posix_impl (cond=<optimized out>, 
    entered_mutex=<optimized out>, abs_time=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./gthread/gthread-posix.c:242
#2  0x00007ffff54078ff in g_async_queue_pop_intern_unlocked (queue=0x62cf30, 
    try=0, end_time=0x7fffdfdf7c50)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gasyncqueue.c:423
#3  0x00007ffff545c419 in g_thread_pool_wait_for_new_task (pool=0x62ced0)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthreadpool.c:274
#4  g_thread_pool_thread_proxy (data=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthreadpool.c:308
#5  0x00007ffff5459cf6 in g_thread_create_proxy (data=0xa044f0)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
#6  0x00007ffff4f55b40 in start_thread (arg=<optimized out>)
    at pthread_create.c:304
#7  0x00007ffff4ca036d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

---Type <return> to continue, or q <return> to quit---
Thread 5 (Thread 0x7fffe548e700 (LWP 7053)):
#0  0x00007ffff4bfd405 in *__GI_raise (sig=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff4c00680 in *__GI_abort () at abort.c:92
#2  0x00007ffff543b32a in g_logv (log_domain=0x0, log_level=<optimized out>, 
    format=0x7ffff5481f88 "%s: assertion `%s' failed", args1=0x7fffe548d470)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmessages.c:557
#3  0x00007ffff543b3b3 in g_log (log_domain=<optimized out>, 
    log_level=<optimized out>, format=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmessages.c:577
#4  0x00007fffef438c89 in gst_audio_decoder_finish_frame (dec=0x653000, 
    buf=0xb526d0, frames=1) at gstaudiodecoder.c:785
#5  0x00007fffe4a86ce3 in vorbis_handle_data_packet (packet=0x7fffe548d650, 
    vd=0x653000, timestamp=<optimized out>, duration=<optimized out>)
    at gstvorbisdec.c:592
#6  vorbis_dec_handle_frame (dec=<optimized out>, buffer=0xb528f0)
    at gstvorbisdec.c:678
#7  0x00007fffef4354e8 in gst_audio_decoder_handle_frame (buffer=0xb528f0, 
    dec=0x653000, klass=<optimized out>) at gstaudiodecoder.c:972
#8  gst_audio_decoder_push_buffers (dec=0x653000, force=0)
    at gstaudiodecoder.c:1061
#9  0x00007fffef4358db in gst_audio_decoder_chain_forward (dec=0x653000, 
---Type <return> to continue, or q <return> to quit---
    buffer=0x0) at gstaudiodecoder.c:1163
#10 0x00007fffef435fdc in gst_audio_decoder_flush_decode (dec=0x653000)
    at gstaudiodecoder.c:1274
#11 gst_audio_decoder_chain_reverse (dec=0x653000, buf=0x0)
    at gstaudiodecoder.c:1354
#12 0x00007fffef43694b in gst_audio_decoder_drain (dec=0x653000)
    at gstaudiodecoder.c:1096
#13 0x00007fffef435d14 in gst_audio_decoder_flush (dec=0x653000, hard=0)
    at gstaudiodecoder.c:1128
#14 0x00007fffef437e48 in gst_audio_decoder_chain (pad=<optimized out>, 
    parent=<optimized out>, buffer=0xa30ab0) at gstaudiodecoder.c:1394
#15 0x00007ffff7935eba in gst_pad_chain_data_unchecked (data=0xa30ab0, 
    type=<optimized out>, pad=0x980620) at gstpad.c:3306
#16 gst_pad_push_data (pad=0x980420, type=<optimized out>, 
    data=<optimized out>) at gstpad.c:3509
#17 0x00007fffeebafbee in gst_single_queue_push_one (object=0xa30ab0, 
    sq=0x654e00, mq=0x84edd0) at gstmultiqueue.c:1056
#18 gst_multi_queue_loop (pad=<optimized out>) at gstmultiqueue.c:1287
#19 0x00007ffff7963c80 in gst_task_func (task=0x958240) at gsttask.c:322
#20 0x00007ffff545c3e4 in g_thread_pool_thread_proxy (data=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthreadpool.c:319
#21 0x00007ffff5459cf6 in g_thread_create_proxy (data=0x961330)
---Type <return> to continue, or q <return> to quit---
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
#22 0x00007ffff4f55b40 in start_thread (arg=<optimized out>)
    at pthread_create.c:304
#23 0x00007ffff4ca036d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#24 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7fffe5c8f700 (LWP 7051)):
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fffeebac2c8 in gst_data_queue_push (queue=0xa06950, 
    item=0x7fffe0002760) at gstdataqueue.c:437
#2  0x00007fffeebaef70 in gst_multi_queue_chain (pad=<optimized out>, 
    parent=<optimized out>, buffer=<optimized out>) at gstmultiqueue.c:1363
#3  0x00007ffff7935eba in gst_pad_chain_data_unchecked (data=0xb50270, 
    type=<optimized out>, pad=0x980220) at gstpad.c:3306
#4  gst_pad_push_data (pad=0x9fe800, type=<optimized out>, 
    data=<optimized out>) at gstpad.c:3509
#5  0x00007fffe5ea730e in gst_ogg_demux_chain_peer (pad=0x9fe800, 
    packet=0x7fffe5c8e7e0, push_headers=0) at gstoggdemux.c:641
#6  0x00007fffe5eaba44 in gst_ogg_pad_submit_packet (packet=0x7fffe5c8e7e0, 
    pad=0x9fe800) at gstoggdemux.c:1034
---Type <return> to continue, or q <return> to quit---
#7  gst_ogg_pad_stream_out (pad=0x9fe800, npackets=1) at gstoggdemux.c:1073
#8  0x00007fffe5eacc10 in gst_ogg_pad_submit_page (pad=0x9fe800, 
    page=0x7fffe5c8eb40) at gstoggdemux.c:1731
#9  0x00007fffe5eafda9 in gst_ogg_demux_handle_page (ogg=0x9fa170, 
    page=0x7fffe5c8eb40) at gstoggdemux.c:4031
#10 0x00007fffe5eb08e8 in gst_ogg_demux_loop_reverse (ogg=0x9fa170)
    at gstoggdemux.c:4274
#11 gst_ogg_demux_loop (pad=<optimized out>) at gstoggdemux.c:4374
#12 0x00007ffff7963c80 in gst_task_func (task=0x958000) at gsttask.c:322
#13 0x00007ffff545c3e4 in g_thread_pool_thread_proxy (data=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthreadpool.c:319
#14 0x00007ffff5459cf6 in g_thread_create_proxy (data=0x9f88f0)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
#15 0x00007ffff4f55b40 in start_thread (arg=<optimized out>)
    at pthread_create.c:304
#16 0x00007ffff4ca036d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#17 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fffe68cd700 (LWP 7049)):
#0  0x00007ffff4f5d89d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007ffff545d2c8 in g_usleep (microseconds=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /tmp/buildd/glib2.0-2.28.6/./glib/gtimer.c:253
#2  0x00007fffe6add1bf in gst_xvimagesink_event_thread (xvimagesink=0x9bc890)
    at xvimagesink.c:1148
#3  0x00007ffff5459cf6 in g_thread_create_proxy (data=0x9c8ee0)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1897
#4  0x00007ffff4f55b40 in start_thread (arg=<optimized out>)
    at pthread_create.c:304
#5  0x00007ffff4ca036d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7f3a920 (LWP 7032)):
#0  __lll_lock_wait ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1  0x00007ffff4f58329 in _L_lock_926 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff4f5814b in __pthread_mutex_lock (mutex=0x980698)
    at pthread_mutex_lock.c:61
#3  0x00007ffff545a128 in g_static_rec_mutex_lock (mutex=0x980690)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c:1424
#4  0x00007ffff7939d30 in post_activate (new_mode=<optimized out>, 
    pad=0x980620) at gstpad.c:831
---Type <return> to continue, or q <return> to quit---
#5  gst_pad_activate_mode (pad=0x980620, mode=GST_PAD_MODE_PUSH, active=0)
    at gstpad.c:1014
#6  0x00007ffff793a618 in gst_pad_set_active (pad=0x980620, active=0)
    at gstpad.c:893
#7  0x00007ffff791e764 in activate_pads (vpad=<optimized out>, 
    ret=0x7fffffffb200, active=0x7fffffffb25c) at gstelement.c:2575
#8  0x00007ffff792d95c in gst_iterator_fold (it=0x840400, 
    func=0x7ffff791e740 <activate_pads>, ret=0x7fffffffb200, 
    user_data=0x7fffffffb25c) at gstiterator.c:614
#9  0x00007ffff791e975 in iterator_activate_fold_with_resync (iter=0x840400, 
    user_data=0x7fffffffb25c, func=0x7ffff791e740 <activate_pads>)
    at gstelement.c:2595
#10 0x00007ffff7920480 in gst_element_pads_activate (element=0x653000, 
    active=0) at gstelement.c:2639
#11 0x00007ffff7920765 in gst_element_change_state_func (element=0x653000, 
    transition=<optimized out>) at gstelement.c:2703
#12 0x00007fffef438648 in gst_audio_decoder_change_state (element=0x653000, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstaudiodecoder.c:2075
#13 0x00007ffff79221bc in gst_element_change_state (element=0x653000, 
    transition=<optimized out>) at gstelement.c:2490
#14 0x00007ffff7922b5b in gst_element_set_state_func (element=0x653000, 
    state=GST_STATE_READY) at gstelement.c:2446
---Type <return> to continue, or q <return> to quit---
#15 0x00007ffff790c705 in gst_bin_element_set_state (next=GST_STATE_READY, 
    current=GST_STATE_PAUSED, start_time=1825498000, base_time=11757567000, 
    element=0x653000, bin=0x97a400) at gstbin.c:2249
#16 gst_bin_change_state_func (element=0x97a400, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:2554
#17 0x00007fffef88f2f0 in gst_decode_bin_change_state (element=0x97a400, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstdecodebin2.c:4041
#18 0x00007ffff79221bc in gst_element_change_state (element=0x97a400, 
    transition=<optimized out>) at gstelement.c:2490
#19 0x00007ffff7922b5b in gst_element_set_state_func (element=0x97a400, 
    state=GST_STATE_READY) at gstelement.c:2446
#20 0x00007ffff790c705 in gst_bin_element_set_state (next=GST_STATE_READY, 
    current=GST_STATE_PAUSED, start_time=1825498000, base_time=11757567000, 
    element=0x97a400, bin=0x97a180) at gstbin.c:2249
#21 gst_bin_change_state_func (element=0x97a180, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:2554
#22 0x00007fffef896a23 in gst_uri_decode_bin_change_state (element=0x97a180, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gsturidecodebin.c:2524
#23 0x00007ffff79221bc in gst_element_change_state (element=0x97a180, 
    transition=<optimized out>) at gstelement.c:2490
#24 0x00007ffff7922b5b in gst_element_set_state_func (element=0x97a180, 
    state=GST_STATE_READY) at gstelement.c:2446
---Type <return> to continue, or q <return> to quit---
#25 0x00007ffff790c705 in gst_bin_element_set_state (next=GST_STATE_READY, 
    current=GST_STATE_PAUSED, start_time=1825498000, base_time=11757567000, 
    element=0x97a180, bin=0x838a60) at gstbin.c:2249
#26 gst_bin_change_state_func (element=0x838a60, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:2554
#27 0x00007ffff793f841 in gst_pipeline_change_state (element=0x838a60, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstpipeline.c:478
#28 0x00007fffef89dc90 in gst_play_bin_change_state (element=0x838a60, 
    transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstplaybin2.c:3945
#29 0x00007ffff79221bc in gst_element_change_state (element=0x838a60, 
    transition=<optimized out>) at gstelement.c:2490
#30 0x00007ffff792223f in gst_element_change_state (element=0x838a60, 
    transition=<optimized out>) at gstelement.c:2527
#31 0x00007ffff7922b5b in gst_element_set_state_func (element=0x838a60, 
    state=GST_STATE_READY) at gstelement.c:2446
#32 0x0000000000409ad3 in stop_cb (button=<optimized out>, 
    data=<optimized out>) at seek.c:696
#33 stop_cb (button=<optimized out>, data=<optimized out>) at seek.c:687
#34 0x0000000000409c7d in delete_event_cb () at seek.c:1772
#35 0x00007ffff7413428 in ?? () from /usr/lib/libgtk-3.so.0
#36 0x00007ffff5cfce7e in g_closure_invoke (closure=0x8beb40, 
    return_value=0x7fffffffbe70, n_param_values=2, param_values=0xa00a90, 
---Type <return> to continue, or q <return> to quit---
    invocation_hint=0x7fffffffbe30)
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gclosure.c:767
#37 0x00007ffff5d0e8d7 in signal_emit_unlocked_R (node=<optimized out>, 
    detail=0, instance=0x84e0d0, emission_return=0x7fffffffbfe0, 
    instance_and_params=0xa00a90)
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c:3252
#38 0x00007ffff5d17aa5 in g_signal_emit_valist (instance=<optimized out>, 
    signal_id=<optimized out>, detail=<optimized out>, 
    var_args=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c:2993
#39 0x00007ffff5d17ed3 in g_signal_emit (instance=<optimized out>, 
    signal_id=<optimized out>, detail=<optimized out>)
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c:3040
#40 0x00007ffff7535e59 in ?? () from /usr/lib/libgtk-3.so.0
#41 0x00007ffff7413307 in gtk_main_do_event () from /usr/lib/libgtk-3.so.0
#42 0x00007ffff7090522 in ?? () from /usr/lib/libgdk-3.so.0
#43 0x00007ffff54324a3 in g_main_dispatch (context=0x7b2a40)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c:2440
#44 g_main_context_dispatch (context=0x7b2a40)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c:3013
#45 0x00007ffff5432c80 in g_main_context_iterate (context=0x7b2a40, block=1, 
    dispatch=1, self=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c:3091
#46 0x00007ffff54332f2 in g_main_loop_run (loop=0x7a8310)
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c:3299
#47 0x00007ffff74124cd in gtk_main () from /usr/lib/libgtk-3.so.0
#48 0x0000000000405f77 in main (argc=3, argv=0x7fffffffc608) at seek.c:2152

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