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 693996 - basetransform: audioresample shutdown unit test fails with 'gst_audio_info_from_caps: caps != NULL' in transform_size
basetransform: audioresample shutdown unit test fails with 'gst_audio_info_fr...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.0.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-16 22:59 UTC by Tim-Philipp Müller
Modified: 2013-02-21 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
basetransform: don't pass NULL outcaps to transform_size on shutdown (1.91 KB, patch)
2013-02-17 00:04 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2013-02-16 22:59:23 UTC
1575  outcaps = gst_pad_get_current_caps (trans->srcpad);

in default_prepare_output_buffer() can return NULL if the source pad has been de-activated already, so check for that and bail out if needed.

This occasionally made the audioresample test_shutdown unit test fail like this:


Starting program: /home/tpm/gst/glib-git/gst-plugins-base/tests/check/elements/.libs/lt-audioresample 
Running suite(s): audioresample

** (lt-audioresample:25861): CRITICAL **: gst_audio_info_from_caps: assertion `caps != NULL' failed

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x2aaaae1cd700 (LWP 25863)]
g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x2aaaae1cc438) at gmessages.c:981
981		  g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
(gdb) thread apply all bt

Thread 3 (Thread 0x2aaaae1cd700 (LWP 25863))

  • #0 g_logv
    at gmessages.c line 981
  • #1 g_log
    at gmessages.c line 1010
  • #2 g_return_if_fail_warning
    at gmessages.c line 1019
  • #3 gst_audio_info_from_caps
    at audio-info.c line 183
  • #4 gst_audio_resample_transform_size
    at gstaudioresample.c line 508
  • #5 gst_base_transform_transform_size
    at gstbasetransform.c line 641
  • #6 default_prepare_output_buffer
    at gstbasetransform.c line 1580
  • #7 gst_base_transform_handle_buffer
    at gstbasetransform.c line 2031
  • #8 gst_base_transform_chain
    at gstbasetransform.c line 2167
  • #9 gst_pad_chain_data_unchecked
    at gstpad.c line 3655
  • #10 gst_pad_push_data
    at gstpad.c line 3872
  • #11 gst_pad_push
    at gstpad.c line 3975
  • #12 gst_base_transform_chain
    at gstbasetransform.c line 2203
  • #13 gst_pad_chain_data_unchecked
    at gstpad.c line 3655
  • #14 gst_pad_push_data
    at gstpad.c line 3872
  • #15 gst_pad_push
    at gstpad.c line 3975
  • #16 gst_base_src_loop
    at gstbasesrc.c line 2723
  • #17 gst_task_func
    at gsttask.c line 316
  • #18 g_thread_pool_thread_proxy
    at gthreadpool.c line 309
  • #19 g_thread_proxy
    at gthread.c line 798
  • #20 start_thread
    at pthread_create.c line 304
  • #21 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #22 ??

Thread 1 (Thread 0x2aaaad53a920 (LWP 25861))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 136
  • #1 _L_lock_997
    from /lib/x86_64-linux-gnu/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 82
  • #3 gst_base_transform_activate
    at gstbasetransform.c line 2300
  • #4 gst_base_transform_sink_activate_mode
    at gstbasetransform.c line 2333
  • #5 gst_pad_activate_mode
    at gstpad.c line 1060
  • #6 gst_pad_set_active
    at gstpad.c line 949
  • #7 activate_pads
    at gstelement.c line 2676
  • #8 gst_iterator_fold
    at gstiterator.c line 614
  • #9 iterator_activate_fold_with_resync
    at gstelement.c line 2696
  • #10 gst_element_pads_activate
    at gstelement.c line 2740
  • #11 gst_element_change_state_func
    at gstelement.c line 2804
  • #12 gst_element_change_state
    at gstelement.c line 2591
  • #13 gst_element_set_state_func
    at gstelement.c line 2547
  • #14 gst_bin_element_set_state
    at gstbin.c line 2292
  • #15 gst_bin_change_state_func
    at gstbin.c line 2594
  • #16 gst_pipeline_change_state
    at gstpipeline.c line 471
  • #17 gst_element_change_state
    at gstelement.c line 2591
  • #18 gst_element_continue_state
    at gstelement.c line 2302
  • #19 gst_element_change_state
    at gstelement.c line 2628
  • #20 gst_element_set_state_func
    at gstelement.c line 2547
  • #21 test_shutdown
    at elements/audioresample.c line 440
  • #22 tcase_run_tfun_nofork
    at check_run.c line 314
  • #23 srunner_iterate_tcase_tfuns
    at check_run.c line 181
  • #24 srunner_run_tcase
    at check_run.c line 302
  • #25 srunner_iterate_suites
    at check_run.c line 150
  • #26 srunner_run_all
    at check_run.c line 561
  • #27 gst_check_run_suite
    at gstcheck.c line 663
  • #28 main
    at elements/audioresample.c line 1115
  • #0 g_logv
    at gmessages.c line 981
  • #1 g_log
    at gmessages.c line 1010
  • #2 g_return_if_fail_warning
    at gmessages.c line 1019
  • #3 gst_audio_info_from_caps
    at audio-info.c line 183
  • #4 gst_audio_resample_transform_size
    at gstaudioresample.c line 508
$2 = {object = {object = {g_type_instance = {g_class = 0x613e90}, ref_count = 1, qdata = 0x0}, lock = {p = 0x68d960, i = {6871392, 0}}, name = 0x68d9d0 "src", parent = 0x68d010, flags = 288, control_bindings = 0x0, 
    control_rate = 100000000, last_sync = 18446744073709551615, _gst_reserved = 0x0}, element_private = 0x0, padtemplate = 0x6739e0, direction = GST_PAD_SRC, stream_rec_lock = {p = 0x68da00, i = {0, 0}}, task = 0x0, block_cond = {
    p = 0x68d990, i = {0, 0}}, probes = {seq_id = 1, hook_size = 72, is_setup = 1, hooks = 0x0, dummy3 = 0x0, finalize_hook = 0x2aaaabdbc010 <default_finalize_hook>, dummy = {0x0, 0x0}}, mode = GST_PAD_MODE_NONE, 
  activatefunc = 0x2aaaab5f1c30 <gst_pad_activate_default>, activatedata = 0x0, activatenotify = 0, activatemodefunc = 0x2aaaab156000 <gst_base_transform_src_activate_mode>, activatemodedata = 0x0, activatemodenotify = 0, 
  peer = 0x678bb0, linkfunc = 0, linkdata = 0x0, linknotify = 0, unlinkfunc = 0, unlinkdata = 0x0, unlinknotify = 0, chainfunc = 0, chaindata = 0x0, chainnotify = 0, chainlistfunc = 0x2aaaab5ee060 <gst_pad_chain_list_default>, 
  chainlistdata = 0x0, chainlistnotify = 0, getrangefunc = 0x2aaaab157970 <gst_base_transform_getrange>, getrangedata = 0x0, getrangenotify = 0, eventfunc = 0x2aaaab155ad0 <gst_base_transform_src_event>, eventdata = 0x0, 
  eventnotify = 0, offset = 0, queryfunc = 0x2aaaad98ef00 <gst_audio_resample_query>, querydata = 0x0, querynotify = 0, iterintlinkfunc = 0x2aaaab5ee750 <gst_pad_iterate_internal_links_default>, iterintlinkdata = 0x0, 
  iterintlinknotify = 0, num_probes = 0, num_blocked = 0, priv = 0x678b90, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}


(Just dumping it here for posteriority/context, in case anyone thinks it should be solved differently.)
Comment 1 Tim-Philipp Müller 2013-02-17 00:03:33 UTC
Should probably be handled in basetransform -> core
Comment 2 Tim-Philipp Müller 2013-02-17 00:04:28 UTC
Created attachment 236420 [details] [review]
basetransform: don't pass NULL outcaps to transform_size on shutdown

    gst_pad_get_current_caps() on the source pad might yield NULL caps
    if we're being shut down and the source pad has already been
    deactivated by the other thread that's changing state. Just bail
    out in that case, instead of passing NULL caps to the transform_size
    function, which it might not expect.
    
    Fixes spurious warnings in audioresample shutdown unit test.
Comment 3 Tim-Philipp Müller 2013-02-21 12:01:56 UTC
Committed, but without the && !gst_pad_is_active(pad) which is not needed (if caps are actually supposed to be NULL this code path should not be called, so if they are NULL we can be sure that's not right).

commit 5a73d15c80d7fbfb4c45e5405c7cfa34571e70a2
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Sat Feb 16 23:02:21 2013 +0000

    basetransform: don't pass NULL outcaps to transform_size on shutdown
    
    gst_pad_get_current_caps() on the source pad might yield NULL caps
    if we're being shut down and the source pad has already been
    deactivated by the other thread that's changing state. Just bail
    out in that case, instead of passing NULL caps to the transform_size
    function, which it might not expect.
    
    Fixes spurious warnings in audioresample shutdown unit test.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693996