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 773414 - Playbin3 hang up while destroying it after failed to send data from source element
Playbin3 hang up while destroying it after failed to send data from source el...
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.9.90
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-24 10:21 UTC by HoonHee Lee
Modified: 2016-12-12 07:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pending stream-collection msg until all parsebins have first buffer (3.67 KB, patch)
2016-10-24 10:26 UTC, HoonHee Lee
none Details | Review
Pending stream-collection msg until all parsebins have first buffer (3.79 KB, patch)
2016-11-02 05:29 UTC, HoonHee Lee
none Details | Review

Description HoonHee Lee 2016-10-24 10:21:49 UTC
Hello All.
 
We are having a following scenario with playbin3 in our TV target.
  
Audio and Video data are fed separately by elementary stream(ES) and so we are using 2 of appsrc elements.
  
But, one of them for our test cases has valid audio stream and non-valid video stream.
  
So, we are expecting playbin3 pipeline is destroyed after non-valid stream for video is detected and appsrc(basesre) changes from PAUSED to READY.
 
However, at that time, pipeline is hanging up.
Deadlock is happened while pipeline tries from PAUSED to READY.
  
Following is backtrace. (Our GST version is based on 1.8)

==============================================
[Switching to thread 8 (Thread 0x71434400 (LWP 24343))]
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #2 gst_play_bin3_handle_message
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstplaybin3.c line 3168
  • #3 bin_bus_handler
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 3119
  • #4 gst_bus_post
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbus.c line 327
  • #5 gst_element_post_message_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1726
  • #6 gst_bin_post_message
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 2643
  • #7 gst_element_post_message
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1769
  • #8 gst_bin_handle_message_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 3905
  • #9 gst_decodebin3_handle_message
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstdecodebin3.c line 1580
  • #10 bin_bus_handler
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 3119
  • #11 gst_bus_post
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbus.c line 327
  • #12 gst_element_post_message_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1726
  • #13 gst_bin_post_message
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 2643
  • #14 gst_element_post_message
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1769
  • #15 gst_bin_handle_message_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 3905
  • #16 gst_parse_bin_handle_message
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstparsebin.c line 4776
  • #17 bin_bus_handler
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 3119
  • #18 gst_bus_post
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbus.c line 327
  • #19 gst_element_post_message_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1726
  • #20 gst_element_post_message
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 1769
  • #21 qtdemux_expose_streams
    at /home/paul/local-work/swfarmhub-gst/gst-plugins-good/gst/isomp4/qtdemux.c line 12887
  • #22 gst_qtdemux_process_adapter
    at /home/paul/local-work/swfarmhub-gst/gst-plugins-good/gst/isomp4/qtdemux.c line 7295
  • #23 gst_qtdemux_chain
    at /home/paul/local-work/swfarmhub-gst/gst-plugins-good/gst/isomp4/qtdemux.c line 7124
  • #24 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #25 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #26 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #27 stop_typefinding
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/plugins/elements/gsttypefindelement.c line 639
  • #28 gst_type_find_element_chain_do_typefinding
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/plugins/elements/gsttypefindelement.c line 969
  • #29 gst_type_find_element_chain
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/plugins/elements/gsttypefindelement.c line 901
  • #30 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #31 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #32 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #33 gst_proxy_pad_chain_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstghostpad.c line 126
  • #34 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #35 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #36 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #37 gst_proxy_pad_chain_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstghostpad.c line 126
  • #38 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #39 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #40 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #41 gst_proxy_pad_chain_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstghostpad.c line 126
  • #42 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #43 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #44 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #45 gst_proxy_pad_chain_default
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstghostpad.c line 126
  • #46 gst_pad_chain_data_unchecked
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4156
  • #47 gst_pad_push_data
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4408
  • #48 gst_pad_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 4527
  • #49 gst_base_src_loop
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/libs/gst/base/gstbasesrc.c line 2994
  • #50 gst_task_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gsttask.c line 332
  • #51 default_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gsttaskpool.c line 68
  • #52 ??
    from /usr/lib/libglib-2.0.so.0
  • #53 ??
    from /usr/lib/libglib-2.0.so.0
  • #54 start_thread
    from /lib/libpthread.so.0
  • #55 ??
    from /lib/libc.so.6
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #2 gst_pad_stop_task
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 6053
  • #3 gst_base_src_stop
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/libs/gst/base/gstbasesrc.c line 3681
  • #4 gst_base_src_activate_push
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/libs/gst/base/gstbasesrc.c line 3853
  • #5 gst_base_src_activate_mode
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/libs/gst/base/gstbasesrc.c line 3925
  • #6 gst_pad_activate_mode
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 1188
  • #7 gst_pad_set_active
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstpad.c line 1072
  • #8 activate_pads
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2736
  • #9 gst_iterator_fold
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstiterator.c line 614
  • #10 iterator_activate_fold_with_resync
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2760
  • #11 gst_element_pads_activate
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2796
  • #12 gst_element_change_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2870
  • #13 gst_base_src_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/libs/gst/base/gstbasesrc.c line 3962
  • #14 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2648
  • #15 gst_element_set_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2602
  • #16 gst_element_set_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2503
  • #17 reset_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 2669
  • #18 foreach_fold_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstiterator.c line 642
  • #19 gst_iterator_fold
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstiterator.c line 614
  • #20 gst_iterator_foreach
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstiterator.c line 669
  • #21 gst_bin_change_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstbin.c line 2943
  • #22 ??
    from /usr/lib/gstreamer-1.0/libgstdynappsrc.so
  • #23 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2648
  • #24 gst_element_continue_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2356
  • #25 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2687
  • #26 gst_element_set_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2602
  • #27 gst_element_set_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2503
  • #28 gst_uri_source_bin_change_state
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gsturisourcebin.c line 2799
  • #29 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2648
  • #30 gst_element_continue_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2356
  • #31 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2687
  • #32 gst_element_set_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2602
  • #33 gst_element_set_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2503
  • #34 activate_group
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstplaybin3.c line 5578
  • #35 setup_next_source
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstplaybin3.c line 5801
  • #36 gst_play_bin3_change_state
    at /usr/src/debug/gstreamer1.0-plugins-base/1.8.0-72.drd4tv.10-r12/git/gst/playback/gstplaybin3.c line 5931
  • #37 gst_element_change_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2648
  • #38 gst_element_set_state_func
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2602
  • #39 gst_element_set_state
    at /usr/src/debug/gstreamer1.0/1.8.0-61.drd4tv.15-r10/git/gst/gstelement.c line 2503
  • #40 mediapipeline::Pipeline::pause
    at pipeline.cpp line 704
  • #41 mediapipeline::DashPlayer::ExecutePreload
    at /home/paul/local-work/custom_pipeline_anal/mpegdash/dashplayer/dashplayer.cpp line 667
  • #42 mediapipeline::DashPlayer::loadSpi
    at /home/paul/local-work/custom_pipeline_anal/mpegdash/dashplayer/dashplayer.cpp line 718
  • #43 mediapipeline::AbstractPlayer::load
    at abstractplayer.cpp line 124
  • #44 StarfishMediaAPIs::pipeline_init(void*)
  • #45 StarfishMediaAPIs::LoadCommon(char const*, void (*)(int, long long, char const*))
  • #46 StarfishMediaPipe::LoadEvent(UMSConnectorHandle*, UMSConnectorMessage*, void*)
  • #47 CallbackManager::CommandCategory::handleCommand(LSHandle*, LSMessage*)
    from /usr/lib/libums_connector.so.1
  • #48 CallbackManager::CommandHandlerProxy(LSHandle*, LSMessage*, void*)
    from /usr/lib/libums_connector.so.1
  • #49 ??
    from /usr/lib/libluna-service2.so.3
  • #50 ??
    from /usr/lib/libluna-service2.so.3
  • #51 ??
    from /usr/lib/libluna-service2.so.3
  • #52 _LSTransportProcessIncomingMessages
    from /usr/lib/libluna-service2.so.3
  • #53 _LSTransportReceiveClient
    from /usr/lib/libluna-service2.so.3
  • #54 ??
    from /usr/lib/libglib-2.0.so.0
  • #55 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #56 ??
    from /usr/lib/libglib-2.0.so.0
  • #57 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #58 UMSConnector::UMSConnector_impl::wait()
    from /usr/lib/libums_connector_impl.so.1
  • #59 StarfishMediaPipe::CreateConnection()
  • #60 main
  
From this backtrace, I confirmed that GST_PLAY_BIN3_LOCK (playbin) is called as twice and GST_PLAY_BIN3_UNLOCK (playbin) is not called as well.
 
Let me explain lock sequence.
1) GST_PLAY_BIN3_LOCK (playbin) is called in setup_next_source ().
2) gst_element_set_state (urisrcbin, target) is not returned in activate_group (). Thus, GST_PLAY_BIN3_UNLOCK (playbin) is not called in setup_next_source ().
3) GST_PLAY_BIN3_LOCK (playbin) is called again in gst_play_bin3_handle_message () to handle GST_MESSAGE_STREAM_COLLECTION.
(Actually, we are adding code to post collection msg in qtdemux)
 
So, dead lock is happened in plybin3 and gst_pad_stop_task of basesrc(audio) is also stucked as they could not return the chain function after posting collection msg.
Comment 1 HoonHee Lee 2016-10-24 10:26:08 UTC
Created attachment 338334 [details] [review]
Pending stream-collection msg until all parsebins have first buffer
Comment 2 HoonHee Lee 2016-10-24 10:27:14 UTC
Dear All.
Please check above deadlock problem and check my review whether it is acceptable or not.
 
Thanks.
Comment 3 HoonHee Lee 2016-11-02 05:29:40 UTC
Created attachment 338926 [details] [review]
Pending stream-collection msg until all parsebins have first buffer
Comment 4 HoonHee Lee 2016-11-02 05:32:30 UTC
Dear All.
I forced to update requested-selection even if stream-collection message is not posting until having first buffer.
If not, decoder for output stream is not created and abnormal behaviour is happened likes unlinked error by absence of requested-selection.
  
Please review this dead lock problem and check my patch is acceptable or not.
 
Thanks.
Comment 5 HoonHee Lee 2016-12-11 22:44:04 UTC
Dear All.
This patch is not needed anymore and I found a defect.
So, No need to review.
 
Thanks.