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 746480 - playbin: deadlock on PMT change in mpeg TS stream
playbin: deadlock on PMT change in mpeg TS stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 747038
 
 
Reported: 2015-03-19 20:07 UTC by Olivier Crête
Modified: 2015-12-16 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix deadlock on chain shutown (1.29 KB, patch)
2015-03-25 15:39 UTC, Vincent Penquerc'h
committed Details | Review

Description Olivier Crête 2015-03-19 20:07:14 UTC
I have a TS sample that has a change in PMT, this causes playbin to deadlock.

http://people.collabora.com/~tester/pmt-change-2.ts

It seems to also be broken on 1.4, so it's not a regression per se.

tack trace of the relevant threads from gst-play-1.0 with git master as of March 19, 2015 (today):

Thread 4 (Thread 0x7fffe7fff700 (LWP 29350))

  • #0 __lll_lock_wait
    at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 135
  • #1 __GI___pthread_mutex_lock
    at ../nptl/pthread_mutex_lock.c line 115
  • #2 post_activate
    at gstpad.c line 992
  • #3 gst_pad_activate_mode
    at gstpad.c line 1180
  • #4 gst_ghost_pad_activate_push_default
    at gstghostpad.c line 379
  • #5 gst_ghost_pad_activate_mode_default
    at gstghostpad.c line 442
  • #6 gst_pad_activate_mode
    at gstpad.c line 1173
  • #7 gst_pad_set_active
    at gstpad.c line 1057
  • #8 pad_removed_cb
    at gsturidecodebin.c line 1238
  • #9 g_cclosure_marshal_VOID__OBJECTv
    at gmarshal.c line 1312
  • #10 _g_closure_invoke_va
    at gclosure.c line 831
  • #11 g_signal_emit_valist
    at gsignal.c line 3218
  • #12 g_signal_emit
    at gsignal.c line 3365
  • #13 gst_element_remove_pad
    at gstelement.c line 803
  • #14 gst_decode_chain_free_internal
    at gstdecodebin2.c line 3247
  • #15 gst_decode_group_free_internal
    at gstdecodebin2.c line 3384
  • #16 gst_decode_group_hide
    at gstdecodebin2.c line 3457
  • #17 drain_and_switch_chains
    at gstdecodebin2.c line 3855
  • #18 gst_decode_pad_handle_eos
    at gstdecodebin2.c line 3905
  • #19 source_pad_event_probe
    at gstdecodebin2.c line 4627
  • #20 probe_hook_marshal
    at gstpad.c line 3320
  • #21 g_hook_list_marshal
    at ghook.c line 672
  • #22 do_probe_callbacks
    at gstpad.c line 3415
  • #23 gst_pad_push_event_unchecked
    at gstpad.c line 4957
  • #24 push_sticky
    at gstpad.c line 3590
  • #25 events_foreach
    at gstpad.c line 583
  • #26 check_sticky
    at gstpad.c line 3646
  • #27 gst_pad_push_event
    at gstpad.c line 5108
  • #28 event_forward_func
    at gstpad.c line 2868
  • #29 gst_pad_forward
    at gstpad.c line 2822
  • #30 gst_pad_event_default
    at gstpad.c line 2919
  • #31 gst_pad_send_event_unchecked
    at gstpad.c line 5296
  • #32 gst_pad_push_event_unchecked
    at gstpad.c line 4983
  • #33 push_sticky
    at gstpad.c line 3590
  • #34 events_foreach
    at gstpad.c line 583
  • #35 check_sticky
    at gstpad.c line 3646
  • #36 gst_pad_push_event
    at gstpad.c line 5108
  • #37 gst_video_decoder_push_event
    at gstvideodecoder.c line 924
  • #38 gst_video_decoder_sink_event_default
    at gstvideodecoder.c line 1228
  • #39 gst_video_decoder_sink_event
    at gstvideodecoder.c line 1264
  • #40 gst_pad_send_event_unchecked
    at gstpad.c line 5296
  • #41 gst_pad_push_event_unchecked
    at gstpad.c line 4983
  • #42 push_sticky
    at gstpad.c line 3590
  • #43 events_foreach
    at gstpad.c line 583
  • #44 check_sticky
    at gstpad.c line 3646
  • #45 gst_pad_push_event
    at gstpad.c line 5108
  • #46 gst_base_parse_sink_event_default
    at gstbaseparse.c line 1247
  • #47 gst_base_parse_sink_event
    at gstbaseparse.c line 963
  • #48 gst_pad_send_event_unchecked
    at gstpad.c line 5296
  • #49 gst_pad_push_event_unchecked
    at gstpad.c line 4983
  • #50 push_sticky
    at gstpad.c line 3590
  • #51 events_foreach
    at gstpad.c line 583
  • #52 check_sticky
    at gstpad.c line 3646
  • #53 gst_pad_push_event
    at gstpad.c line 5108
  • #54 gst_single_queue_push_one
    at gstmultiqueue.c line 1279
  • #55 gst_multi_queue_loop
    at gstmultiqueue.c line 1516
  • #56 gst_task_func
    at gsttask.c line 331
  • #57 default_func
    at gsttaskpool.c line 68
  • #58 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #59 g_thread_proxy
    at gthread.c line 764
  • #60 start_thread
    at pthread_create.c line 310
  • #61 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Comment 1 Vincent Penquerc'h 2015-03-25 15:39:14 UTC
Created attachment 300291 [details] [review]
fix deadlock on chain shutown
Comment 2 Vincent Penquerc'h 2015-04-03 14:43:52 UTC
commit 77dc09c3a9a5e5e371e189f39b5557db440a8dc9
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Wed Mar 25 15:36:38 2015 +0000

    decodebin2: fix deadlock on chain shutdown
    
    When shutting down the chain, we can get a deadlock when removing
    a pad, if that chain was being busy streaming but blocked (eg, while
    waiting for a queue to have free space).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746480
Comment 3 Olivier Crête 2015-04-21 01:09:00 UTC
I finally got a decent repro:

1. Used the following branches from mtl.collabora.ca:

 - mmfd: gdp
 - gst-p-bad: vecima
 - gst-p-vaapi: wayland

And the following files
 - the config file at jalfrezi.collabora.co.uk:~tester/pmt-change-bug/mmfd.cfg
 - and the dump jalfrezi.collabora.co.uk:~tester/pmt-change-bug/myd_0.1428767699975019.gdp

Then I run it as: ./mmfd 0

Then at the end of the trailer, after it switches to the next clip, the sound goes away sometimes... Or the pipeline freezes and causes the restart mechanism to be triggered, which it shouldn't be.
Comment 4 Olivier Crête 2015-04-21 01:21:39 UTC
arg.. wrong bug
Comment 5 Sebastian Dröge (slomo) 2015-12-16 16:11:10 UTC
This commit is not a good idea. I have a case here where the flush events go to the sinks! Also the commit is not even required anymore with latest GIT master for whatever reason. Let's just revert it for now...


commit 60bad4815db966a8e4f69e333203a995e38e0159
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Dec 16 17:07:54 2015 +0100

    Revert "decodebin2: fix deadlock on chain shutdown"
    
    This reverts commit 77dc09c3a9a5e5e371e189f39b5557db440a8dc9.
    
    It can cause the FLUSH_START/STOP events to go to the sink elements, which
    then causes state changes and various other problems. We shouldn't really
    flush downstream here, the idea is to do *draining*.
    
    Apart from that the testcase for the original bug here works without this
    commit now.