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 566393 - [deadlock] Setting index on a pipeline
[deadlock] Setting index on a pipeline
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.22
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-03 09:10 UTC by Edward Hervey
Modified: 2009-01-05 10:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Edward Hervey 2009-01-03 09:10:49 UTC
When setting a GstIndex on a pipeline containing index-aware elements, a deadlock happens.

A simplified backtrace is the following (with flvdemux):
* gst_bin_set_index_func
* acquires the OBJECT_LOCK to iterate children
* calls set_index on child
* flv_demux_set_index asks for a writer id
* gstindex uses gst_object_get_path_string to calculate unique id
* gst_object_get_path tries to get the parent of flvdemux
==> DEADLOCK, the parent object lock was already acquired in gst_bin_set_index_func


Full backtrace:
(gdb) bt
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_102
    from /lib/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 86
  • #3 gst_object_get_parent
    at gstobject.c line 834
  • #4 gst_object_get_path_string
    at gstobject.c line 1080
  • #5 gst_index_path_resolver
    at gstindex.c line 626
  • #6 gst_index_get_writer_id
    at gstindex.c line 695
  • #7 gst_flv_demux_set_index
    at gstflvdemux.c line 1150
  • #8 gst_bin_set_index_func
    at gstbin.c line 635
  • #9 _wrap_gst_element_set_index
    at gst.c line 4496
  • #10 PyEval_EvalFrameEx
    at Python/ceval.c line 3573
  • #11 PyEval_EvalCodeEx
    at Python/ceval.c line 2836
  • #12 PyEval_EvalCode
    at Python/ceval.c line 494
  • #13 run_mod
    at Python/pythonrun.c line 1273
  • #14 PyRun_FileExFlags
    at Python/pythonrun.c line 1259
  • #15 PyRun_SimpleFileExFlags
    at Python/pythonrun.c line 879
  • #16 Py_Main
    at Modules/main.c line 523
  • #17 __libc_start_main
    at libc-start.c line 226
  • #18 _start


Simple python script to trigger the above:

p = gst.parse_launch("filesrc ! flvdemux ! fakesink")
i = gst.index_factory_make("memindex")
print "Before setting index"
p.set_index(i)
print "After setting index"
Comment 1 Wim Taymans 2009-01-05 10:14:41 UTC
        * gst/gstbin.c: (gst_bin_set_index_func), (gst_bin_set_clock_func),
        (gst_bin_change_state_func):
        Use an iterator to set the clock and the index so that we can release
        the object lock appropriately. Fixes #566393.