After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667562 - [0.11] Race condition between streaming thread and resetting pads in downwards state change
[0.11] Race condition between streaming thread and resetting pads in downward...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.11.x
Other Linux
: Normal blocker
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-09 14:40 UTC by Sebastian Dröge (slomo)
Modified: 2012-07-19 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audiodecoder: Don't assert on pad caps not being set (1.24 KB, patch)
2012-07-19 08:55 UTC, Edward Hervey
none Details | Review

Description Sebastian Dröge (slomo) 2012-01-09 14:40:07 UTC
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

Thread 1 (Thread 0x7ffff7f3a920 (LWP 7032))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 136
  • #1 _L_lock_926
    from /lib/x86_64-linux-gnu/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 61
  • #3 g_static_rec_mutex_lock
    at /tmp/buildd/glib2.0-2.28.6/./glib/gthread.c line 1424
  • #4 post_activate
    at gstpad.c line 831
  • #5 gst_pad_activate_mode
    at gstpad.c line 1014
  • #6 gst_pad_set_active
    at gstpad.c line 893
  • #7 activate_pads
    at gstelement.c line 2575
  • #8 gst_iterator_fold
    at gstiterator.c line 614
  • #9 iterator_activate_fold_with_resync
    at gstelement.c line 2595
  • #10 gst_element_pads_activate
    at gstelement.c line 2639
  • #11 gst_element_change_state_func
    at gstelement.c line 2703
  • #12 gst_audio_decoder_change_state
    at gstaudiodecoder.c line 2075
  • #13 gst_element_change_state
    at gstelement.c line 2490
  • #14 gst_element_set_state_func
    at gstelement.c line 2446
  • #15 gst_bin_element_set_state
    at gstbin.c line 2249
  • #16 gst_bin_change_state_func
    at gstbin.c line 2554
  • #17 gst_decode_bin_change_state
    at gstdecodebin2.c line 4041
  • #18 gst_element_change_state
    at gstelement.c line 2490
  • #19 gst_element_set_state_func
    at gstelement.c line 2446
  • #20 gst_bin_element_set_state
    at gstbin.c line 2249
  • #21 gst_bin_change_state_func
    at gstbin.c line 2554
  • #22 gst_uri_decode_bin_change_state
    at gsturidecodebin.c line 2524
  • #23 gst_element_change_state
    at gstelement.c line 2490
  • #24 gst_element_set_state_func
    at gstelement.c line 2446
  • #25 gst_bin_element_set_state
    at gstbin.c line 2249
  • #26 gst_bin_change_state_func
    at gstbin.c line 2554
  • #27 gst_pipeline_change_state
    at gstpipeline.c line 478
  • #28 gst_play_bin_change_state
    at gstplaybin2.c line 3945
  • #29 gst_element_change_state
    at gstelement.c line 2490
  • #30 gst_element_change_state
    at gstelement.c line 2527
  • #31 gst_element_set_state_func
    at gstelement.c line 2446
  • #32 stop_cb
    at seek.c line 696
  • #33 stop_cb
    at seek.c line 687
  • #34 delete_event_cb
    at seek.c line 1772
  • #35 ??
    from /usr/lib/libgtk-3.so.0
  • #36 g_closure_invoke
  • #37 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3252
  • #38 g_signal_emit_valist
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 2993
  • #39 g_signal_emit
    at /tmp/buildd/glib2.0-2.28.6/./gobject/gsignal.c line 3040
  • #40 ??
    from /usr/lib/libgtk-3.so.0
  • #41 gtk_main_do_event
    from /usr/lib/libgtk-3.so.0
  • #42 ??
    from /usr/lib/libgdk-3.so.0
  • #43 g_main_dispatch
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 2440
  • #44 g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 3013
  • #45 g_main_context_iterate
  • #46 g_main_loop_run
    at /tmp/buildd/glib2.0-2.28.6/./glib/gmain.c line 3299
  • #47 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #48 main
    at seek.c line 2152

Comment 1 Tim-Philipp Müller 2012-05-28 20:00:47 UTC
There were state-change related fixes lately, do those help with this by any chance?
Comment 2 Edward Hervey 2012-07-12 08:22:21 UTC
The behaviour it encounters is not fatal imho.

The pads being deactivated while the streaming thread is active is a common behaviour, and the expected result is to return GST_FLOW_WRONG_STATE.

Either we can use GST_PAD_IS_ACTIVE (srcpad) or we can store a local variable to know if we are active or not. And if it's not the case, return GST_FLOW_WRONG_STATE.
Comment 3 Edward Hervey 2012-07-19 08:55:54 UTC
Created attachment 219202 [details] [review]
audiodecoder: Don't assert on pad caps not being set

The decoder might have been de-activated in the meantime (resulting
in NULL pad caps).

If the decoder really isn't configured, then it will error out further
down when checking whether the GST_AUDIO_INFO_IS_VALID()
Comment 4 Edward Hervey 2012-07-19 10:13:48 UTC
commit 55f692eff682b78c924c5d79087e9f91e4dc93bb
Author: Edward Hervey <edward.hervey@collabora.co.uk>
Date:   Thu Jul 19 10:54:07 2012 +0200

    audiodecoder: Don't assert on pad caps not being set
    
    The decoder might have been de-activated in the meantime (resulting
    in NULL pad caps).
    
    If the decoder really isn't configured, then it will error out further
    down when checking whether the GST_AUDIO_INFO_IS_VALID()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667562