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 729321 - playbin/subtitleoverlay: Deadlock when changing subtitle track while PAUSED
playbin/subtitleoverlay: Deadlock when changing subtitle track while PAUSED
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: 1.2.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-01 10:27 UTC by Thibault Saunier
Modified: 2014-05-10 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Some more debug logs + the full backtrace (115.12 KB, text/plain)
2014-05-01 10:30 UTC, Thibault Saunier
  Details
subtitleoverlay: Don't block on non-serialized events (1.03 KB, patch)
2014-05-01 11:05 UTC, Sebastian Dröge (slomo)
committed Details | Review
playsinkconvertbin: Don't block on non-serialized events (1.03 KB, patch)
2014-05-01 11:09 UTC, Sebastian Dröge (slomo)
committed Details | Review
playsink: Don't block on non-serialized events (1.55 KB, patch)
2014-05-01 11:09 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Thibault Saunier 2014-05-01 10:27:25 UTC
When trying to change a subtitle track while the pipeline is PAUSED, it deadlock 100% of the time.

The only thing that should be done to change subtitle track is:

    g_object_set(playbin, "current-text", $SOMETRACKID, NULL);

When doing that on a PAUSED playbin pipeline we get that traceback:

Thread 1 (Thread 0x7f936e84b840 (LWP 13004))

  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 185
  • #1 g_cond_wait
    at gthread-posix.c line 753
  • #2 do_probe_callbacks
    at gstpad.c line 3294
  • #3 gst_pad_push_event_unchecked
    at gstpad.c line 4762
  • #4 gst_pad_push_event
    at gstpad.c line 4920
  • #5 event_forward_func
    at gstpad.c line 2828
  • #6 gst_pad_forward
    at gstpad.c line 2782
  • #7 gst_pad_event_default
    at gstpad.c line 2879
  • #8 gst_subtitle_overlay_subtitle_sink_event
    at gstsubtitleoverlay.c line 1930
  • #9 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #10 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #11 gst_pad_push_event
    at gstpad.c line 4920
  • #12 gst_validate_pad_monitor_downstream_event_check
    at gst-validate-pad-monitor.c line 1341
  • #13 gst_validate_pad_monitor_sink_event_func
    at gst-validate-pad-monitor.c line 1537
  • #14 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #15 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #16 gst_pad_push_event
    at gstpad.c line 4920
  • #17 event_forward_func
    at gstpad.c line 2828
  • #18 gst_pad_forward
    at gstpad.c line 2782
  • #19 gst_pad_event_default
    at gstpad.c line 2879
  • #20 gst_play_sink_sink_event
    at gstplaysink.c line 2134
  • #21 gst_play_sink_text_sink_event
    at gstplaysink.c line 2306
  • #22 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #23 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #24 gst_pad_push_event
    at gstpad.c line 4920
  • #25 event_forward_func
    at gstpad.c line 2828
  • #26 gst_pad_forward
    at gstpad.c line 2782
  • #27 gst_pad_event_default
    at gstpad.c line 2879
  • #28 gst_stream_synchronizer_sink_event
    at gststreamsynchronizer.c line 515
  • #29 gst_validate_pad_monitor_downstream_event_check
    at gst-validate-pad-monitor.c line 1341
  • #30 gst_validate_pad_monitor_sink_event_func
    at gst-validate-pad-monitor.c line 1537
  • #31 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #32 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #33 gst_pad_push_event
    at gstpad.c line 4920
  • #34 event_forward_func
    at gstpad.c line 2828
  • #35 gst_pad_forward
    at gstpad.c line 2782
  • #36 gst_pad_event_default
    at gstpad.c line 2879
  • #37 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #38 gst_pad_send_event
    at gstpad.c line 5253
  • #39 gst_play_bin_send_custom_event
    at gstplaybin2.c line 1832
  • #40 combiner_active_pad_changed
    at gstplaybin2.c line 2866
  • #41 g_closure_invoke
    at gclosure.c line 777
  • #42 signal_emit_unlocked_R
    at gsignal.c line 3586
  • #43 g_signal_emit_valist
    at gsignal.c line 3330
  • #44 g_signal_emit
    at gsignal.c line 3386
  • #45 g_object_dispatch_properties_changed
    at gobject.c line 1047
  • #46 gst_object_dispatch_properties_changed
    at gstobject.c line 448
  • #47 g_object_notify_queue_thaw
    at gobject.c line 292
  • #48 g_object_set_valist
    at gobject.c line 2132
  • #49 g_object_set
    at gobject.c line 2232
  • #50 gst_play_bin_set_current_text_stream
    at gstplaybin2.c line 2145
  • #51 gst_play_bin_set_property
    at gstplaybin2.c line 2260
  • #52 object_set_property
    at gobject.c line 1366
  • #53 g_object_set_valist
    at gobject.c line 2126
  • #54 g_object_set
    at gobject.c line 2232
  • #55 _execute_switch_track
    at gst-validate.c line 252
  • #56 get_position
    at gst-validate-scenario.c line 684
  • #57 g_timeout_dispatch
    at gmain.c line 4450
  • #58 g_main_dispatch
    at gmain.c line 3065
  • #59 g_main_context_dispatch
    at gmain.c line 3641
  • #60 g_main_context_iterate
    at gmain.c line 3712
  • #61 g_main_loop_run
    at gmain.c line 3906
  • #62 main
    at gst-validate.c line 428

And last line of the debug log look like:

0:00:02.307971241 [333m13004[00m      0x233fe00 [37mDEBUG  [00m [00m     subtitleoverlay gstsubtitleoverlay.c:1881:gst_subtitle_overlay_subtitle_sink_event:<suboverlay:subtitle_sink>[00m Got event custom-downstream-oob event: 0x2528440, time 99:99:99.999999999, seq-num 2368, playsink-custom-subtitle-flush-finish;
0:00:02.307993140 [333m13004[00m      0x233fe00 [37mDEBUG  [00m [00m     subtitleoverlay gstsubtitleoverlay.c:1007:_pad_blocked_cb:<subtitle_sink:proxypad39>[00m Pad blocked
0:00:02.308003465 [333m13004[00m      0x233fe00 [37mDEBUG  [00m [00m     subtitleoverlay gstsubtitleoverlay.c:1038:_pad_blocked_cb:<suboverlay>[00m Current subtitle caps: text/x-raw, format=(string)pango-markup
0:00:02.308017699 [333m13004[00m      0x233fe00 [37mDEBUG  [00m [00m     subtitleoverlay gstsubtitleoverlay.c:1075:_pad_blocked_cb:<suboverlay>[00m Subtitle sink blocked but video not blocked
0:00:02.308026609 [333m13004[00m      0x233fe00 [37mDEBUG  [00m [00;01;31;41m            GST_PADS gstpad.c:3183:probe_hook_marshal:<subtitle_sink:proxypad39>[00m probe returned OK

Basically what I understand is that on the main thread subtitlesoverlay starts waiting for its video sink pad to be blocked but that will never happen as we are PAUSED, queues are all full and we are prerolled.

Any idea about how to fix that?

You can simply reproduce using totem and the http://www.sintel.org/download  sample file.
Comment 1 Thibault Saunier 2014-05-01 10:28:33 UTC
I meant to paste the backtrace with all threads:

Thread 1 (Thread 0x7f936e84b840 (LWP 13004))

  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 185
  • #1 g_cond_wait
    at gthread-posix.c line 753
  • #2 do_probe_callbacks
    at gstpad.c line 3294
  • #3 gst_pad_push_event_unchecked
    at gstpad.c line 4762
  • #4 gst_pad_push_event
    at gstpad.c line 4920
  • #5 event_forward_func
    at gstpad.c line 2828
  • #6 gst_pad_forward
    at gstpad.c line 2782
  • #7 gst_pad_event_default
    at gstpad.c line 2879
  • #8 gst_subtitle_overlay_subtitle_sink_event
    at gstsubtitleoverlay.c line 1930
  • #9 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #10 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #11 gst_pad_push_event
    at gstpad.c line 4920
  • #12 gst_validate_pad_monitor_downstream_event_check
    at gst-validate-pad-monitor.c line 1341
  • #13 gst_validate_pad_monitor_sink_event_func
    at gst-validate-pad-monitor.c line 1537
  • #14 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #15 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #16 gst_pad_push_event
    at gstpad.c line 4920
  • #17 event_forward_func
    at gstpad.c line 2828
  • #18 gst_pad_forward
    at gstpad.c line 2782
  • #19 gst_pad_event_default
    at gstpad.c line 2879
  • #20 gst_play_sink_sink_event
    at gstplaysink.c line 2134
  • #21 gst_play_sink_text_sink_event
    at gstplaysink.c line 2306
  • #22 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #23 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #24 gst_pad_push_event
    at gstpad.c line 4920
  • #25 event_forward_func
    at gstpad.c line 2828
  • #26 gst_pad_forward
    at gstpad.c line 2782
  • #27 gst_pad_event_default
    at gstpad.c line 2879
  • #28 gst_stream_synchronizer_sink_event
    at gststreamsynchronizer.c line 515
  • #29 gst_validate_pad_monitor_downstream_event_check
    at gst-validate-pad-monitor.c line 1341
  • #30 gst_validate_pad_monitor_sink_event_func
    at gst-validate-pad-monitor.c line 1537
  • #31 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #32 gst_pad_push_event_unchecked
    at gstpad.c line 4795
  • #33 gst_pad_push_event
    at gstpad.c line 4920
  • #34 event_forward_func
    at gstpad.c line 2828
  • #35 gst_pad_forward
    at gstpad.c line 2782
  • #36 gst_pad_event_default
    at gstpad.c line 2879
  • #37 gst_pad_send_event_unchecked
    at gstpad.c line 5096
  • #38 gst_pad_send_event
    at gstpad.c line 5253
  • #39 gst_play_bin_send_custom_event
    at gstplaybin2.c line 1832
  • #40 combiner_active_pad_changed
    at gstplaybin2.c line 2866
  • #41 g_closure_invoke
    at gclosure.c line 777
  • #42 signal_emit_unlocked_R
    at gsignal.c line 3586
  • #43 g_signal_emit_valist
    at gsignal.c line 3330
  • #44 g_signal_emit
    at gsignal.c line 3386
  • #45 g_object_dispatch_properties_changed
    at gobject.c line 1047
  • #46 gst_object_dispatch_properties_changed
    at gstobject.c line 448
  • #47 g_object_notify_queue_thaw
    at gobject.c line 292
  • #48 g_object_set_valist
    at gobject.c line 2132
  • #49 g_object_set
    at gobject.c line 2232
  • #50 gst_play_bin_set_current_text_stream
    at gstplaybin2.c line 2145
  • #51 gst_play_bin_set_property
    at gstplaybin2.c line 2260
  • #52 object_set_property
    at gobject.c line 1366
  • #53 g_object_set_valist
    at gobject.c line 2126
  • #54 g_object_set
    at gobject.c line 2232
  • #55 _execute_switch_track
    at gst-validate.c line 252
  • #56 get_position
    at gst-validate-scenario.c line 684
  • #57 g_timeout_dispatch
    at gmain.c line 4450
  • #58 g_main_dispatch
    at gmain.c line 3065
  • #59 g_main_context_dispatch
    at gmain.c line 3641
  • #60 g_main_context_iterate
    at gmain.c line 3712
  • #61 g_main_loop_run
    at gmain.c line 3906
  • #62 main
    at gst-validate.c line 428

Comment 2 Thibault Saunier 2014-05-01 10:30:39 UTC
Created attachment 275526 [details]
Some more debug logs + the full backtrace

Interesting I did paste the full backtrace but BZ trims it to the main thread only.
Comment 3 Sebastian Dröge (slomo) 2014-05-01 10:50:28 UTC
Have to find out what the pad probe is that is blocking the event from the main thread. It should probably GST_PAD_PROBE_PASS all non-serialized events.
Comment 4 Sebastian Dröge (slomo) 2014-05-01 11:05:35 UTC
Created attachment 275527 [details] [review]
subtitleoverlay: Don't block on non-serialized events
Comment 5 Sebastian Dröge (slomo) 2014-05-01 11:05:53 UTC
Does this fix it?
Comment 6 Sebastian Dröge (slomo) 2014-05-01 11:09:32 UTC
Created attachment 275528 [details] [review]
playsinkconvertbin: Don't block on non-serialized events
Comment 7 Sebastian Dröge (slomo) 2014-05-01 11:09:51 UTC
Created attachment 275529 [details] [review]
playsink: Don't block on non-serialized events
Comment 8 Sebastian Dröge (slomo) 2014-05-01 11:18:32 UTC
commit 0d87f8fdb2f881300c63ebd8b1535568e5979b2a
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu May 1 13:15:57 2014 +0200

    playbin: Don't block on non-serialized events
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729321

commit 4d062b230a10d41442dbc6dd964a9e97db816e9a
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu May 1 13:08:24 2014 +0200

    playsink: Don't block on non-serialized events
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729321

commit 67289fd18417d1c9fadf6429bd5ac490751577c4
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu May 1 13:06:53 2014 +0200

    playsinkconvertbin: Don't block on non-serialized events
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729321

commit ab0e37c32032679fb6d80c36220d7d877d497178
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu May 1 13:05:05 2014 +0200

    subtitleoverlay: Don't block on non-serialized events
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729321