GNOME Bugzilla – Bug 693996
basetransform: audioresample shutdown unit test fails with 'gst_audio_info_from_caps: caps != NULL' in transform_size
Last modified: 2013-02-21 12:02:18 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
+ Trace 231526
Thread 3 (Thread 0x2aaaae1cd700 (LWP 25863))
Thread 1 (Thread 0x2aaaad53a920 (LWP 25861))
$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.)
Should probably be handled in basetransform -> core
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.
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