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 775993 - validate: Deadlock when doing PAUSE->PLAYING dance on BUFFERING messages while transcoding in filesink
validate: Deadlock when doing PAUSE->PLAYING dance on BUFFERING messages whil...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-12 16:07 UTC by Thibault Saunier
Modified: 2018-11-03 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
validate: transcode: No buffering handling when the sink is not synced on the clock (2.06 KB, patch)
2016-12-12 16:07 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2016-12-12 16:07:40 UTC
Created attachment 341827 [details] [review]
validate: transcode: No buffering handling when the sink is not synced on the clock

In gst-validate-transcoder-1.0 we respect do the BUFFERING message and PAUSE the pipeline when starting buffering and go back to PLAYING when this is done, and that even if the sink is not synchronized on the clock.

Validate test: validate.http.transcode.to_vorbis_and_vp8_in_webm.raw_video_mkv

In racy/rare conditions we get a deadlock when `prerolling` going to PAUSED with the following stack trace:

Thread 6 (Thread 0x7fbb541e8700 (LWP 21847))

  • #0 syscall
  • #1 g_cond_wait
  • #2 gst_queue2_wait_free_space
    at gstqueue2.c line 1826
  • #3 gst_queue2_chain_buffer_or_buffer_list
    at gstqueue2.c line 2754
  • #4 gst_queue2_chain
    at gstqueue2.c line 2815
  • #5 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #6 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #7 gst_pad_push_data
    at gstpad.c line 4455
  • #8 gst_pad_push
    at gstpad.c line 4574
  • #9 gst_type_find_element_chain
    at gsttypefindelement.c line 896
  • #10 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #11 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #12 gst_pad_push_data
    at gstpad.c line 4455
  • #13 gst_pad_push
    at gstpad.c line 4574
  • #14 gst_base_src_loop
    at gstbasesrc.c line 2855
  • #15 gst_task_func
    at gsttask.c line 334
  • #16 default_func
    at gsttaskpool.c line 68
  • #17 g_thread_pool_thread_proxy
  • #18 g_thread_proxy
  • #19 start_thread
  • #20 clone

Thread 5 (Thread 0x7fbb537cd700 (LWP 21853))

  • #0 syscall
  • #1 g_cond_wait
  • #2 gst_data_queue_push
    at gstdataqueue.c line 520
  • #3 gst_multi_queue_chain
    at gstmultiqueue.c line 2112
  • #4 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #5 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #6 gst_pad_push_data
    at gstpad.c line 4455
  • #7 gst_pad_push
    at gstpad.c line 4574
  • #8 gst_matroska_demux_parse_blockgroup_or_simpleblock
    at matroska-demux.c line 3842
  • #9 gst_matroska_demux_parse_id
    at matroska-demux.c line 4507
  • #10 gst_matroska_demux_chain
    at matroska-demux.c line 4889
  • #11 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #12 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #13 gst_pad_push_data
    at gstpad.c line 4455
  • #14 gst_pad_push
    at gstpad.c line 4574
  • #15 gst_type_find_element_chain
    at gsttypefindelement.c line 896
  • #16 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #17 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #18 gst_pad_push_data
    at gstpad.c line 4455
  • #19 gst_pad_push
    at gstpad.c line 4574
  • #20 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #21 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #22 gst_pad_push_data
    at gstpad.c line 4455
  • #23 gst_pad_push
    at gstpad.c line 4574
  • #24 gst_queue2_push_one
    at gstqueue2.c line 2908
  • #25 gst_queue2_loop
    at gstqueue2.c line 3030
  • #26 gst_task_func
    at gsttask.c line 334
  • #27 default_func
    at gsttaskpool.c line 68
  • #28 g_thread_pool_thread_proxy
  • #29 g_thread_proxy
  • #30 start_thread
  • #31 clone

Thread 4 (Thread 0x7fbb529ca700 (LWP 21860))

  • #0 syscall
  • #1 g_cond_wait
  • #2 gst_queue_chain_buffer_or_list
    at gstqueue.c line 1222
  • #3 gst_queue_chain
    at gstqueue.c line 1320
  • #4 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #5 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #6 gst_pad_push_data
    at gstpad.c line 4455
  • #7 gst_pad_push
    at gstpad.c line 4574
  • #8 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #9 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #10 gst_pad_push_data
    at gstpad.c line 4455
  • #11 gst_pad_push
    at gstpad.c line 4574
  • #12 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #13 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #14 gst_pad_push_data
    at gstpad.c line 4455
  • #15 gst_pad_push
    at gstpad.c line 4574
  • #16 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #17 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #18 gst_pad_push_data
    at gstpad.c line 4455
  • #19 gst_pad_push
    at gstpad.c line 4574
  • #20 gst_single_queue_push_one
    at gstmultiqueue.c line 1611
  • #21 gst_multi_queue_loop
    at gstmultiqueue.c line 1923
  • #22 gst_task_func
    at gsttask.c line 334
  • #23 default_func
    at gsttaskpool.c line 68
  • #24 g_thread_pool_thread_proxy
  • #25 g_thread_proxy
  • #26 start_thread
  • #27 clone

Thread 3 (Thread 0x7fbb51610700 (LWP 21865))

  • #0 syscall
  • #1 g_cond_wait
  • #2 gst_queue_chain_buffer_or_list
    at gstqueue.c line 1222
  • #3 gst_queue_chain
    at gstqueue.c line 1320
  • #4 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #5 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #6 gst_pad_push_data
    at gstpad.c line 4455
  • #7 gst_pad_push
    at gstpad.c line 4574
  • #8 gst_base_transform_chain
    at gstbasetransform.c line 2378
  • #9 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #10 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #11 gst_pad_push_data
    at gstpad.c line 4455
  • #12 gst_pad_push
    at gstpad.c line 4574
  • #13 gst_stream_combiner_chain
    at gststreamcombiner.c line 111
  • #14 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #15 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #16 gst_pad_push_data
    at gstpad.c line 4455
  • #17 gst_pad_push
    at gstpad.c line 4574
  • #18 gst_video_encoder_finish_frame
    at gstvideoencoder.c line 2204
  • #19 gst_vpx_enc_process
    at gstvpxenc.c line 1732
  • #20 gst_vpx_enc_handle_frame
    at gstvpxenc.c line 1921
  • #21 gst_video_encoder_chain
    at gstvideoencoder.c line 1461
  • #22 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #23 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #24 gst_pad_push_data
    at gstpad.c line 4455
  • #25 gst_pad_push
    at gstpad.c line 4574
  • #26 gst_base_transform_chain
    at gstbasetransform.c line 2378
  • #27 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #28 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #29 gst_pad_push_data
    at gstpad.c line 4455
  • #30 gst_pad_push
    at gstpad.c line 4574
  • #31 gst_video_rate_flush_prev
    at gstvideorate.c line 707
  • #32 gst_video_rate_transform_ip
    at gstvideorate.c line 1434
  • #33 default_generate_output
    at gstbasetransform.c line 2184
  • #34 gst_base_transform_chain
    at gstbasetransform.c line 2342
  • #35 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #36 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #37 gst_pad_push_data
    at gstpad.c line 4455
  • #38 gst_pad_push
    at gstpad.c line 4574
  • #39 gst_base_transform_chain
    at gstbasetransform.c line 2378
  • #40 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #41 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #42 gst_pad_push_data
    at gstpad.c line 4455
  • #43 gst_pad_push
    at gstpad.c line 4574
  • #44 gst_base_transform_chain
    at gstbasetransform.c line 2378
  • #45 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #46 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #47 gst_pad_push_data
    at gstpad.c line 4455
  • #48 gst_pad_push
    at gstpad.c line 4574
  • #49 gst_base_transform_chain
    at gstbasetransform.c line 2378
  • #50 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #51 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #52 gst_pad_push_data
    at gstpad.c line 4455
  • #53 gst_pad_push
    at gstpad.c line 4574
  • #54 gst_stream_splitter_chain
    at gststreamsplitter.c line 140
  • #55 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #56 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #57 gst_pad_push_data
    at gstpad.c line 4455
  • #58 gst_pad_push
    at gstpad.c line 4574
  • #59 gst_queue_push_one
    at gstqueue.c line 1359
  • #60 gst_queue_loop
    at gstqueue.c line 1506
  • #61 gst_task_func
    at gsttask.c line 334
  • #62 default_func
    at gsttaskpool.c line 68
  • #63 g_thread_pool_thread_proxy
  • #64 g_thread_proxy
  • #65 start_thread
  • #66 clone

Thread 2 (Thread 0x7fbb50e0f700 (LWP 21868))

  • #0 syscall
  • #1 g_cond_wait
  • #2 gst_base_sink_wait_preroll
    at gstbasesink.c line 2266
  • #3 gst_base_sink_do_preroll
    at gstbasesink.c line 2360
  • #4 gst_base_sink_do_sync
    at gstbasesink.c line 2562
  • #5 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3518
  • #6 gst_base_sink_chain_main
    at gstbasesink.c line 3674
  • #7 gst_base_sink_chain
    at gstbasesink.c line 3703
  • #8 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #9 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #10 gst_pad_push_data
    at gstpad.c line 4455
  • #11 gst_pad_push
    at gstpad.c line 4574
  • #12 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #13 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #14 gst_pad_push_data
    at gstpad.c line 4455
  • #15 gst_pad_push
    at gstpad.c line 4574
  • #16 gst_ebml_write_flush_cache
    at ebml-write.c line 271
  • #17 gst_ebml_write_header
    at ebml-write.c line 940
  • #18 gst_matroska_mux_start
    at matroska-mux.c line 2768
  • #19 gst_matroska_mux_handle_buffer
    at matroska-mux.c line 3794
  • #20 gst_collect_pads_default_collected
    at gstcollectpads.c line 1567
  • #21 gst_collect_pads_check_collected
    at gstcollectpads.c line 1368
  • #22 gst_collect_pads_chain
    at gstcollectpads.c line 2216
  • #23 gst_validate_pad_monitor_chain_func
    at gst-validate-pad-monitor.c line 2121
  • #24 gst_pad_chain_data_unchecked
    at gstpad.c line 4203
  • #25 gst_pad_push_data
    at gstpad.c line 4455
  • #26 gst_pad_push
    at gstpad.c line 4574
  • #27 gst_queue_push_one
    at gstqueue.c line 1359
  • #28 gst_queue_loop
    at gstqueue.c line 1506
  • #29 gst_task_func
    at gsttask.c line 334
  • #30 default_func
    at gsttaskpool.c line 68
  • #31 g_thread_pool_thread_proxy
  • #32 g_thread_proxy
  • #33 start_thread
  • #34 clone

Going to PAUSED when BUFFERING on a pipeline that is not sync on the clock is useless so I attach here a patch that removes that behaviour in -validate but this case should still work and defenitely not deadlock.
Comment 1 Edward Hervey 2016-12-12 16:19:47 UTC
Review of attachment 341827 [details] [review]:

::: validate/tools/gst-validate-transcoding.c
@@ +478,3 @@
+          g_object_class_find_property (G_OBJECT_GET_CLASS (sink), "sync");
+
+      if (spec) {

We should also not buffer if the sink doesn't have a "sync" property ?
Comment 2 Thibault Saunier 2016-12-12 16:29:46 UTC
(In reply to Edward Hervey from comment #1)
> Review of attachment 341827 [details] [review] [review]:
> 
> ::: validate/tools/gst-validate-transcoding.c
> @@ +478,3 @@
> +          g_object_class_find_property (G_OBJECT_GET_CLASS (sink), "sync");
> +
> +      if (spec) {
> 
> We should also not buffer if the sink doesn't have a "sync" property ?

Well, who knows in that case? :)
Comment 3 Thibault Saunier 2016-12-12 18:15:34 UTC
Comment on attachment 341827 [details] [review]
validate: transcode: No buffering handling when the sink is not synced on the clock

Pushed with suggested change about missing 'sync' property

commit ca85c454829ae8effa31551d56735e5ec2f5a3f6
Author: Thibault Saunier <tsaunier@gnome.org>
Date:   Mon Dec 12 12:27:42 2016 -0300

    validate: transcode: No buffering handling when the sink is not synced on the clock
    
    It makes no sense to pause the pipeline and wait for buffering to be
    done when the pipeline is just processing the data as it comes
    in without synchronizing on the clock.
Comment 4 Sebastian Dröge (slomo) 2016-12-13 09:31:27 UTC
What if a child of the sink bin has the "sync" property? ;)


Do we know why it deadlocks?
Comment 5 GStreamer system administrator 2018-11-03 12:38:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/209.