[Bug 785987] New: adaptivedemux: Deadlock on stopping pipeline
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Tue Aug 8 08:47:27 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=785987
Bug ID: 785987
Summary: adaptivedemux: Deadlock on stopping pipeline
Classification: Platform
Product: GStreamer
Version: 1.12.2
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gst-plugins-bad
Assignee: gstreamer-bugs at lists.freedesktop.org
Reporter: davecraig at unbalancedaudio.com
QA Contact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
Created attachment 357171
--> https://bugzilla.gnome.org/attachment.cgi?id=357171&action=edit
Possible patch
If a pipeline is stopped when there are pending_streams in an adaptiveplaylist,
then there can be a deadlock. gst_adaptive_demux_stop_tasks only stops
demux->streams and not demux->pending_streams which can also be running.
To test this I was playing
http://hls.iptv.optimum.net/news12/nipadlive/index_new.m3u8?callsign=N12KN
and continuously restarting playback after a random delay of 0 to 10 seconds.
It would deadlock within a minute or two. With the attached patch there is no
longer a deadlock.
Thread 21 (LWP 1501):
#0 syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37
#1 0xb6839458 in g_cond_wait (cond=0x810cf3e4, mutex=0x810cf3dc) at
../../glib-2.50.2/glib/gthread-posix.c:1395
#2 0x7cef955c in gst_adaptive_demux_stream_push_buffer
(stream=stream at entry=0xae042f80, buffer=buffer at entry=0x7b199698) at
../../../../clone/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:2308
#3 0x7d60d9fe in gst_hls_demux_handle_buffer (demux=demux at entry=0x810cf428,
stream=stream at entry=0xae042f80, buffer=<optimized out>, at_eos=at_eos at entry=0)
at ../../../clone/ext/hls/gsthlsdemux.c:927
#4 0x7d60de96 in gst_hls_demux_data_received (demux=0x810cf428,
stream=0xae042f80, buffer=<optimized out>) at
../../../clone/ext/hls/gsthlsdemux.c:1040
#5 0x7cef7f40 in _src_chain (pad=<optimized out>, parent=0x810cf428,
buffer=0x6cc0d170) at
../../../../clone/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:2524
#6 0xb2738804 in gst_pad_chain_data_unchecked (data=0x6cc0d170, type=4112,
pad=0x75fa12c8) at ../../clone/gst/gstpad.c:4220
#7 gst_pad_push_data (pad=pad at entry=0xad4dfa50, type=type at entry=4112,
data=<optimized out>, data at entry=0x6cc0d170) at ../../clone/gst/gstpad.c:4464
#8 0xb273c380 in gst_pad_push (pad=pad at entry=0xad4dfa50,
buffer=buffer at entry=0x6cc0d170) at ../../clone/gst/gstpad.c:4583
#9 0xb272f140 in gst_proxy_pad_chain_default (pad=0x75f01340,
parent=<optimized out>, buffer=0x6cc0d170) at ../../clone/gst/gstghostpad.c:127
#10 0xb2738804 in gst_pad_chain_data_unchecked (data=0x6cc0d170, type=4112,
pad=0x75f01340) at ../../clone/gst/gstpad.c:4220
#11 gst_pad_push_data (pad=pad at entry=0x75fa1028, type=type at entry=4112,
data=<optimized out>, data at entry=0x6cc0d170) at ../../clone/gst/gstpad.c:4464
#12 0xb273c380 in gst_pad_push (pad=0x75fa1028, buffer=buffer at entry=0x6cc0d170)
at ../../clone/gst/gstpad.c:4583
#13 0x7fb9b07e in gst_queue_push_one (queue=0x71838810) at
../../../clone/plugins/elements/gstqueue.c:1365
#14 gst_queue_loop (pad=<optimized out>) at
../../../clone/plugins/elements/gstqueue.c:1517
#15 0xb27579aa in gst_task_func (task=0x72c99370) at
../../clone/gst/gsttask.c:335
#16 0xb6826002 in g_thread_pool_thread_proxy (data=<optimized out>) at
../../glib-2.50.2/glib/gthreadpool.c:307
#17 0xb6825a6e in g_thread_proxy (data=0xade77920) at
../../glib-2.50.2/glib/gthread.c:784
#18 0xb69208d2 in start_thread (arg=0x0) at pthread_create.c:335
#19 0xb09c1bb2 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:86
Thread 1 (LWP 1371):
#0 __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
#1 0xb6928490 in __lll_lock_wait (futex=0x7ad9e7a0, private=0) at
lowlevellock.c:46
#2 0xb6922b1e in __GI___pthread_mutex_lock (mutex=0x7ad9e7a0) at
pthread_mutex_lock.c:115
#3 0xb273a6c8 in post_activate (new_mode=GST_PAD_MODE_NONE, pad=0x75f01340) at
../../clone/gst/gstpad.c:1015
#4 activate_mode_internal (pad=pad at entry=0x75f01340,
parent=parent at entry=0xad4dfa50, mode=mode at entry=GST_PAD_MODE_PUSH,
active=active at entry=0) at ../../clone/gst/gstpad.c:1186
#5 0xb273a9a6 in gst_pad_activate_mode (pad=pad at entry=0x75f01340,
mode=mode at entry=GST_PAD_MODE_PUSH, active=active at entry=0) at
../../clone/gst/gstpad.c:1273
#6 0xb272f578 in gst_ghost_pad_activate_push_default (parent=<optimized out>,
active=0, pad=0xad4dfa50) at ../../clone/gst/gstghostpad.c:383
#7 gst_ghost_pad_activate_mode_default (pad=0xad4dfa50, parent=<optimized
out>, mode=<optimized out>, active=0) at ../../clone/gst/gstghostpad.c:449
#8 0xb273a69e in activate_mode_internal (pad=pad at entry=0xad4dfa50,
parent=parent at entry=0x75f2b708, mode=mode at entry=GST_PAD_MODE_PUSH,
active=active at entry=0) at ../../clone/gst/gstpad.c:1179
#9 0xb273a8b8 in gst_pad_set_active (pad=pad at entry=0xad4dfa50, active=0) at
../../clone/gst/gstpad.c:1080
#10 0xb2712630 in activate_pads (vpad=<optimized out>, ret=0xbed06a50,
active=0xbed06a4c) at ../../clone/gst/gstbin.c:2630
#11 0xb27309c0 in gst_iterator_fold (it=it at entry=0xad670e50,
func=func at entry=0xb2712619 <activate_pads>, ret=ret at entry=0xbed06a50,
user_data=user_data at entry=0xbed06a4c) at ../../clone/gst/gstiterator.c:617
#12 0xb271200a in iterator_activate_fold_with_resync (user_data=0xbed06a4c,
iter=0xad670e50) at ../../clone/gst/gstbin.c:2653
#13 gst_bin_src_pads_activate (bin=bin at entry=0x75f2b708, active=<optimized
out>, active at entry=0) at ../../clone/gst/gstbin.c:2687
#14 0xb2715248 in gst_bin_change_state_func (element=0x75f2b708,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../../clone/gst/gstbin.c:2881
#15 0xb272a980 in gst_element_change_state (element=0x75f2b708,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../clone/gst/gstelement.c:2743
#16 0xb272ac26 in gst_element_set_state_func (element=0x75f2b708,
state=<optimized out>) at ../../clone/gst/gstelement.c:2697
#17 0x7cef9a06 in gst_adaptive_demux_stream_free (stream=0xae042f80) at
../../../../clone/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:1428
#18 0xb680b40e in g_list_foreach (list=<optimized out>, list at entry=0xad86f200,
func=0x7cef98f9 <gst_adaptive_demux_stream_free>,
user_data=user_data at entry=0x0) at ../../glib-2.50.2/glib/glist.c:1005
#19 0xb680b42e in g_list_free_full (list=0xad86f200, free_func=<optimized out>)
at ../../glib-2.50.2/glib/glist.c:220
#20 0x7cef9b06 in gst_adaptive_demux_reset (demux=demux at entry=0x810cf428) at
../../../../clone/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:812
#21 0x7cef9f76 in gst_adaptive_demux_change_state (element=0x810cf428,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../../../clone/gst-libs/gst/adaptivedemux/gstadaptivedemux.c:581
#22 0x7d60e3b8 in gst_hls_demux_change_state (element=0x810cf428,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../../clone/ext/hls/gsthlsdemux.c:212
#23 0xb272a980 in gst_element_change_state (element=0x810cf428,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../clone/gst/gstelement.c:2743
#24 0xb272ac26 in gst_element_set_state_func (element=0x810cf428,
state=<optimized out>) at ../../clone/gst/gstelement.c:2697
#25 0xb2715148 in gst_bin_element_set_state (next=<optimized out>,
current=<optimized out>, start_time=0, base_time=113630886264,
element=0x810cf428, bin=<optimized out>) at ../../clone/gst/gstbin.c:2589
#26 gst_bin_change_state_func (element=0xad4dde38,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../../clone/gst/gstbin.c:2931
#27 0x7fb54cb6 in gst_decode_bin_change_state (element=0xad4dde38,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../../gst-plugins-base-1.12.2/gst/playback/gstdecodebin2.c:5342
#28 0xb272a980 in gst_element_change_state (element=0xad4dde38,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../clone/gst/gstelement.c:2743
#29 0xb272ac26 in gst_element_set_state_func (element=0xad4dde38,
state=<optimized out>) at ../../clone/gst/gstelement.c:2697
#30 0xb2715148 in gst_bin_element_set_state (next=<optimized out>,
current=<optimized out>, start_time=0, base_time=113630886264,
element=0xad4dde38, bin=<optimized out>) at ../../clone/gst/gstbin.c:2589
#31 gst_bin_change_state_func (element=0xad4ce580,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../../clone/gst/gstbin.c:2931
#32 0x7fb5c7e6 in gst_uri_decode_bin_change_state (element=0xad4ce580,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../../gst-plugins-base-1.12.2/gst/playback/gsturidecodebin.c:2737
#33 0xb272a980 in gst_element_change_state (element=0xad4ce580,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../clone/gst/gstelement.c:2743
#34 0xb272ac26 in gst_element_set_state_func (element=0xad4ce580,
state=<optimized out>) at ../../clone/gst/gstelement.c:2697
#35 0xb2715148 in gst_bin_element_set_state (next=<optimized out>,
current=<optimized out>, start_time=0, base_time=113630886264,
element=0xad4ce580, bin=<optimized out>) at ../../clone/gst/gstbin.c:2589
#36 gst_bin_change_state_func (element=0xad4cb098,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../../clone/gst/gstbin.c:2931
#37 0xb272a980 in gst_element_change_state (element=0xad4cb098,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at
../../clone/gst/gstelement.c:2743
#38 0xb272ac26 in gst_element_set_state_func (element=0xad4cb098,
state=<optimized out>) at ../../clone/gst/gstelement.c:2697
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list