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 634927 - id3v2 typefind pull_range versus live source deadlock
id3v2 typefind pull_range versus live source deadlock
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-15 18:26 UTC by Andy Wingo
Modified: 2012-09-11 00:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andy Wingo 2010-11-15 18:26:41 UTC
From today's GStreamer (all of it):

Thread 1 (Thread 0x7f02ddf07720 (LWP 16659))

  • #0 pthread_cond_wait
    from /lib64/libpthread.so.0
  • #1 gst_base_src_wait_playing
    at gstbasesrc.c line 493
  • #2 gst_base_src_get_range
    at gstbasesrc.c line 2097
  • #3 gst_base_src_pad_get_range
    at gstbasesrc.c line 2267
  • #4 gst_pad_get_range_unchecked
    at gstpad.c line 4668
  • #5 gst_pad_pull_range
    at gstpad.c line 4830
  • #6 gst_pad_get_range_unchecked
    at gstpad.c line 4668
  • #7 gst_pad_pull_range
    at gstpad.c line 4830
  • #8 helper_find_peek
    at gsttypefindhelper.c line 129
  • #9 id3v2_type_find
    at gsttypefindfunctions.c line 502
  • #10 gst_type_find_factory_call_function
    at gsttypefindfactory.c line 220
  • #11 gst_type_find_helper_get_range_ext
    at gsttypefindhelper.c line 323
  • #12 gst_type_find_element_activate
    at gsttypefindelement.c line 955
  • #13 gst_pad_set_active
    at gstpad.c line 690
  • #14 activate_pads
    at gstelement.c line 2687
  • #15 gst_iterator_fold
    at gstiterator.c line 549
  • #16 iterator_activate_fold_with_resync
    at gstelement.c line 2719
  • #17 gst_element_pads_activate
    at gstelement.c line 2764
  • #18 gst_element_change_state_func
    at gstelement.c line 2833
  • #19 gst_type_find_element_change_state
    at gsttypefindelement.c line 1025
  • #20 gst_element_change_state
    at gstelement.c line 2603
  • #21 gst_element_set_state_func
    at gstelement.c line 2559
  • #22 gst_bin_element_set_state
    at gstbin.c line 2184
  • #23 gst_bin_change_state_func
    at gstbin.c line 2483
  • #24 gst_decode_bin_change_state
    at gstdecodebin2.c line 3560
  • #25 gst_element_change_state
    at gstelement.c line 2603
  • #26 gst_element_set_state_func
    at gstelement.c line 2559
  • #27 gst_bin_element_set_state
    at gstbin.c line 2184
  • #28 gst_bin_change_state_func
    at gstbin.c line 2483
  • #29 gst_pipeline_change_state
    at gstpipeline.c line 475
  • #30 gst_element_change_state
    at gstelement.c line 2603
  • #31 gst_element_change_state
    at gstelement.c line 2640
  • #32 gst_element_set_state_func
    at gstelement.c line 2559


The end of a GST_DEBUG=3 log is this:

0:00:05.053817216 16659       0x929500 DEBUG           GST_REGISTRY gstregistry.c:545:gst_registry_add_feature:<registry0> adding feature 0xb5d690 (image/vnd.adobe.photoshop)
0:00:05.053825260 16659       0x929500 INFO            GST_TYPEFIND gsttypefind.c:82:gst_type_find_register: registering typefind function for xdgmime-base
0:00:05.053838491 16659       0x929500 DEBUG           GST_TYPEFIND gsttypefind.c:85:gst_type_find_register:<typefindfactory296> using new typefind factory for xdgmime-base
0:00:05.053848251 16659       0x929500 DEBUG           GST_REGISTRY gstregistry.c:538:gst_registry_add_feature:<registry0> replacing existing feature 0x963090 (xdgmime-base)
0:00:05.053862507 16659       0x929500 DEBUG           GST_REGISTRY gstregistry.c:545:gst_registry_add_feature:<registry0> adding feature 0xb5e080 (xdgmime-base)
0:00:05.053871352 16659       0x929500 INFO      GST_PLUGIN_LOADING gstplugin.c:857:gst_plugin_load_file: plugin "/opt/yobuild/lib64/gstreamer-0.10/libgsttypefindfunctions.so" loaded
0:00:05.053880335 16659       0x929500 DEBUG     GST_PLUGIN_LOADING gstpluginfeature.c:114:gst_plugin_feature_load: loaded plugin typefindfunctions
0:00:05.053905922 16659       0x929500 DEBUG                basesrc gstbasesrc.c:492:gst_base_src_wait_playing:<audiosrc> live source waiting for running state
Comment 1 Andy Wingo 2010-11-16 11:23:06 UTC
This bug can be reproduced via:

  gst-launch pulsesrc ! decodebin2 ! fakesink

The typefindelement in decodebin succeeds in activating pulsesrc in pull mode, tries to pull from within the pad activate function, and deadlocks.
Comment 2 Tim-Philipp Müller 2010-12-07 16:33:22 UTC
Why does a live source activate in pull mode at all? GstBaseSrc bug?
Comment 3 Kishore Arepalli 2010-12-15 15:58:48 UTC
pulsesrc is activated in PULL mode because of the below method.


static gboolean
gst_base_audio_src_check_get_range (GstBaseSrc * bsrc)
{
  /* we allow limited pull base operation of which the details
   * will eventually exposed in an as of yet non-existing query.
   * Basically pulling can be done on any number of bytes as long
   * as the offset is -1 or sequentially increasing. */
  return TRUE;
}
Comment 4 Kishore Arepalli 2010-12-16 09:18:14 UTC
(In reply to comment #2)
> Why does a live source activate in pull mode at all? GstBaseSrc bug?

I think this problem because of BaseAudioSrc (Comment 3)
Comment 5 Erik Botö 2011-06-13 13:42:41 UTC
Any news on this? I'm running in to the same issue.
Comment 6 Wim Taymans 2011-06-15 11:15:03 UTC
The scheduling query was added in 0.11 now. I guess we should disable pullmode scheduling in 0.10 (or at least make a can-activate-pull property in basesrc)
Comment 7 Erik Botö 2011-06-15 13:00:40 UTC
I got it working by patching pulsesrc to use a custom check_get_range that returns false. But as you say it might be nice with a property in basesrc instead as it would make it easier for stuff that derives from that.
Comment 8 Tim-Philipp Müller 2012-09-11 00:52:17 UTC
commit a85991eeb8eaf15b9d01f3e2013ba1f3dfef38ee
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Mon Sep 10 21:39:32 2012 +0100

    baseparse, typefind: only activate in pull mode if upstream is seekable
    
    Upstream might support pull mode, but only sequential pulls,
    which isn't gonna do much for us.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634927