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 773131 - playbin3: Fix deadlock when adding multiple parsebin
playbin3: Fix deadlock when adding multiple parsebin
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.10.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-18 05:38 UTC by Wonchul Lee
Modified: 2016-11-15 10:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playbin3: Fix deadlock when adding multiple parsebin (1.26 KB, patch)
2016-10-18 05:39 UTC, Wonchul Lee
none Details | Review

Description Wonchul Lee 2016-10-18 05:38:38 UTC
It can be rarely reproduced with validate.dash.playback.change_state_intensive.dash_exMPD_BIP_TC1 validate case.

It happens when decodebin consist more than two parsebin in the pipeline such as the dash case and intensive playback. One holds SourceGroup lock in urisrc_pad_added() and try to acquire shutdown lock in pad_added_cb(). The other hold shutdown lock in no_more_pads_cb() and try to get SourceGroup lock. So I try to release SourceGroup lock before request a pad what will trigger pad_added_cb() in urisrc_pad_added().

In addition, I saw another type of deadlock with this validate test case which occurs regardless of this case. (not yet investigated deeply)

* Attached related stack trace

Thread 6 (Thread 0x7fffd758b700 (LWP 1032))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_mutex_lock_slowpath
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./glib/gthread-posix.c line 1314
  • #2 no_more_pads_cb
    at gstplaybin3.c line 3129
  • #3 pad_added_cb
    at gstplaybin3.c line 2940
  • #4 g_cclosure_marshal_VOID__OBJECTv
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gmarshal.c line 1312
  • #5 _g_closure_invoke_va
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gclosure.c line 831
  • #6 g_signal_emit_valist
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3218
  • #7 g_signal_emit
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3365
  • #8 gst_element_add_pad
    at gstelement.c line 713
  • #9 reconfigure_output_stream
    at gstdecodebin3.c line 1891
  • #10 multiqueue_src_probe
    at gstdecodebin3.c line 1480
  • #11 probe_hook_marshal
    at gstpad.c line 3469
  • #12 g_hook_list_marshal
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./glib/ghook.c line 672
  • #13 do_probe_callbacks
    at gstpad.c line 3621
  • #14 gst_pad_push_event_unchecked
    at gstpad.c line 5238
  • #15 push_sticky
    at gstpad.c line 3807
  • #16 events_foreach
    at gstpad.c line 603
  • #17 check_sticky
    at gstpad.c line 3864
  • #18 gst_pad_push_event
    at gstpad.c line 5395
  • #19 gst_single_queue_push_one
    at gstmultiqueue.c line 1652
  • #20 gst_multi_queue_loop
    at gstmultiqueue.c line 1915
  • #21 gst_task_func
    at gsttask.c line 334
  • #22 default_func
    at gsttaskpool.c line 68
  • #23 g_thread_pool_thread_proxy
  • #24 g_thread_proxy
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./glib/gthread.c line 764
  • #25 start_thread
    at pthread_create.c line 309
  • #26 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 111

Thread 7 (Thread 0x7fffd6d8a700 (LWP 2103))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_mutex_lock_slowpath
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./glib/gthread-posix.c line 1314
  • #2 pad_added_cb
    at gstplaybin3.c line 2807
  • #3 g_cclosure_marshal_VOID__OBJECTv
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gmarshal.c line 1312
  • #4 _g_closure_invoke_va
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gclosure.c line 831
  • #5 g_signal_emit_valist
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3218
  • #6 g_signal_emit
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3365
  • #7 gst_element_add_pad
    at gstelement.c line 713
  • #8 create_new_input
    at gstdecodebin3.c line 861
  • #9 gst_decodebin3_request_new_pad
    at gstdecodebin3.c line 878
  • #10 _gst_element_request_pad
    at gstelement.c line 982
  • #11 gst_element_get_request_pad
    at gstelement.c line 1088
  • #12 urisrc_pad_added
    at gstplaybin3.c line 4529
  • #13 g_cclosure_marshal_VOID__OBJECTv
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gmarshal.c line 1312
  • #14 _g_closure_invoke_va
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gclosure.c line 831
  • #15 g_signal_emit_valist
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3218
  • #16 g_signal_emit
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./gobject/gsignal.c line 3365
  • #17 gst_element_add_pad
    at gstelement.c line 713
  • #18 expose_output_pad
    at gsturisourcebin.c line 1318
  • #19 pending_pad_blocked
    at gsturisourcebin.c line 990
  • #20 probe_hook_marshal
    at gstpad.c line 3469
  • #21 g_hook_list_marshal
    at /build/glib2.0-y6934K/glib2.0-2.42.1/./glib/ghook.c line 672
  • #22 do_probe_callbacks
    at gstpad.c line 3621
  • #23 gst_pad_push_event_unchecked
    at gstpad.c line 5231
  • #24 push_sticky
    at gstpad.c line 3807
  • #25 events_foreach
    at gstpad.c line 603
  • #26 check_sticky
    at gstpad.c line 3864
  • #27 gst_pad_push_event
    at gstpad.c line 5395
  • #28 gst_adaptive_demux_stream_push_buffer
    at gstadaptivedemux.c line 2058
  • #29 gst_dash_demux_data_received

Comment 1 Wonchul Lee 2016-10-18 05:39:27 UTC
Created attachment 337915 [details] [review]
playbin3: Fix deadlock when adding multiple parsebin
Comment 2 Jan Schmidt 2016-11-15 10:08:01 UTC
Thanks, pushed to master and 1.10:

commit 8b95d17f75f2959175c387307be7449d752bef09
Author: Wonchul Lee <wonchul.lee@collabora.com>
Date:   Mon Oct 17 15:38:37 2016 +0900

    playbin3: Fix deadlock when adding multiple parsebin
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773131