deadlock when stop gstreamer
Shuke
shuke987 at qq.com
Sat Jan 12 13:36:03 UTC 2019
Guys,
I had a trouble when try to stop gstreamer . I want to stop playing before
EOF, using gst_element_set_state function. But the call never return, and
deadlock happened.
Pipeline looks like:
.--------------. .------------------------------------------.
| playbin | |mybin .------------. .------------. |
|----. .----| |-----. | capsfilter | | fakesink | |
|sink| |src |---> |ghost| |----. .---| |----. .---| |
handoff
|----' '----| |pad |-->|sink| |src|-->|sink| |src|--+-->
handler
| | |-----' '------------' '------------' |
'--------------' '------------------------------------------'
and bt is:
(gdb) thread apply all bt
Thread 4 (Thread 0x7fb57b1aa700 (LWP 28534)):
#0 0x00007fb58cc0a66d in nanosleep () at /lib64/libc.so.6
#1 0x00007fb58cc3b2f4 in usleep () at /lib64/libc.so.6
#2 0x00007fb58d03b66d in Report::DoReport(void*) ()
at /usr/local/cvd/sip-user-agent/sip-plugin/build/libsip-plugin.so
#3 0x00007fb586f56070 in () at /lib64/libstdc++.so.6
#4 0x00007fb58d8a3dc5 in start_thread () at /lib64/libpthread.so.0
#5 0x00007fb58cc4376d in clone () at /lib64/libc.so.6
Thread 3 (Thread 0x7fb568a6b700 (LWP 2929)):
#0 0x00007fb58d8aa1bd in __lll_lock_wait () at /lib64/libpthread.so.0
#1 0x00007fb58d8a5d1d in _L_lock_840 () at /lib64/libpthread.so.0
#2 0x00007fb58d8a5c3a in pthread_mutex_lock () at /lib64/libpthread.so.0
#3 0x00007fb582b1da31 in g_static_rec_mutex_lock () at
/lib64/libglib-2.0.so.0
#4 0x00007fb56bbb90a2 in new_pad () at
/usr/lib64/gstreamer-0.10/libgstdecodebin.so
#5 0x00007fb56bbb91ac in new_caps () at
/usr/lib64/gstreamer-0.10/libgstdecodebin.so
#6 0x00007fb583593ac8 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#7 0x00007fb5835a616d in signal_emit_unlocked_R () at
/lib64/libgobject-2.0.so.0
#8 0x00007fb5835ae1e1 in g_signal_emit_valist () at
/lib64/libgobject-2.0.so.0
#9 0x00007fb5835ae4cf in g_signal_emit () at /lib64/libgobject-2.0.so.0
#10 0x00007fb5835983a4 in g_object_dispatch_properties_changed () at
/lib64/libgobject-2.0.so.0
#11 0x00007fb5837fcf74 in gst_object_dispatch_properties_changed () at
/lib64/libgstreamer-0.10.so.0
#12 0x00007fb58359a8d9 in g_object_notify_by_pspec () at
/lib64/libgobject-2.0.so.0
#13 0x00007fb58382b8d4 in gst_pad_set_caps () at
/lib64/libgstreamer-0.10.so.0
#14 0x00007fb56af7b4d4 in gst_mpeg_audio_parse_parse_frame () at
/usr/lib64/gstreamer-0.10/libgstaudioparsers.so
#15 0x00007fb5782b9124 in gst_base_parse_handle_and_push_frame.isra.7 () at
/usr/lib64/libgstbase-0.10.so.0
#16 0x00007fb5782bbc43 in gst_base_parse_loop () at
/usr/lib64/libgstbase-0.10.so.0
#17 0x00007fb583856a14 in gst_task_func () at /lib64/libgstreamer-0.10.so.0
#18 0x00007fb582b7230c in g_thread_pool_thread_proxy () at
/lib64/libglib-2.0.so.0
#19 0x00007fb582b71970 in g_thread_proxy () at /lib64/libglib-2.0.so.0
#20 0x00007fb58d8a3dc5 in start_thread () at /lib64/libpthread.so.0
#21 0x00007fb58cc4376d in clone () at /lib64/libc.so.6
Thread 2 (Thread 0x7fb57958e700 (LWP 3324)):
#0 0x00007fb58d8aa1bd in __lll_lock_wait () at /lib64/libpthread.so.0
#1 0x00007fb58d8a5d1d in _L_lock_840 () at /lib64/libpthread.so.0
#2 0x00007fb58d8a5c3a in pthread_mutex_lock () at /lib64/libpthread.so.0
#3 0x00007fb582b1da31 in g_static_rec_mutex_lock () at
/lib64/libglib-2.0.so.0
#4 0x00007fb5782b4825 in gst_base_parse_activate () at
/usr/lib64/libgstbase-0.10.so.0
#5 0x00007fb5782b48df in gst_base_parse_sink_activate_pull () at
/usr/lib64/libgstbase-0.10.so.0
#6 0x00007fb58382f401 in gst_pad_activate_pull () at
/lib64/libgstreamer-0.10.so.0
#7 0x00007fb58382ff37 in gst_pad_set_active () at
/lib64/libgstreamer-0.10.so.0
#8 0x00007fb583811f21 in activate_pads () at /lib64/libgstreamer-0.10.so.0
#9 0x00007fb58382325d in gst_iterator_fold () at
/lib64/libgstreamer-0.10.so.0
#10 0x00007fb583811fab in iterator_activate_fold_with_resync () at
/lib64/libgstreamer-0.10.so.0
#11 0x00007fb58381459d in gst_element_pads_activate () at
/lib64/libgstreamer-0.10.so.0
#12 0x00007fb583814874 in gst_element_change_state_func () at
/lib64/libgstreamer-0.10.so.0
#13 0x00007fb5782b571d in gst_base_parse_change_state () at
/usr/lib64/libgstbase-0.10.so.0
#14 0x00007fb5838163b2 in gst_element_change_state () at
/lib64/libgstreamer-0.10.so.0
#15 0x00007fb583816a23 in gst_element_set_state_func () at
/lib64/libgstreamer-0.10.so.0
#16 0x00007fb583804412 in gst_bin_change_state_func () at
/lib64/libgstreamer-0.10.so.0
#17 0x00007fb56bbb7441 in gst_decode_bin_change_state () at
/usr/lib64/gstreamer-0.10/libgstdecodebin.so
#18 0x00007fb5838163b2 in gst_element_change_state () at
/lib64/libgstreamer-0.10.so.0
#19 0x00007fb583816a23 in gst_element_set_state_func () at
/lib64/libgstreamer-0.10.so.0
#20 0x00007fb583804412 in gst_bin_change_state_func () at
/lib64/libgstreamer-0.10.so.0
#21 0x00007fb583834552 in gst_pipeline_change_state () at
/lib64/libgstreamer-0.10.so.0
#22 0x00007fb578b6e8fd in gst_play_base_bin_change_state () at
/usr/lib64/gstreamer-0.10/libgstplaybin.so
#23 0x00007fb578b55665 in gst_play_bin_change_state () at
/usr/lib64/gstreamer-0.10/libgstplaybin.so
#24 0x00007fb5838163b2 in gst_element_change_state () at
/lib64/libgstreamer-0.10.so.0
#25 0x00007fb583816a23 in gst_element_set_state_func () at
/lib64/libgstreamer-0.10.so.0
#26 0x00007fb583804412 in gst_bin_change_state_func () at
/lib64/libgstreamer-0.10.so.0
#27 0x00007fb583834552 in gst_pipeline_change_state () at
/lib64/libgstreamer-0.10.so.0
#28 0x00007fb5838163b2 in gst_element_change_state () at
/lib64/libgstreamer-0.10.so.0
#29 0x00007fb583816a23 in gst_element_set_state_func () at
/lib64/libgstreamer-0.10.so.0
#30 0x00007fb583abfd6e in thread (arg=0x1765e7e0) at modules/gst/gst.c:93
#31 0x00007fb58d8a3dc5 in start_thread () at /lib64/libpthread.so.0
#32 0x00007fb58cc4376d in clone () at /lib64/libc.so.6
Thread 1 (Thread 0x7fb58ea12980 (LWP 28516)):
#0 0x00007fb58d8a4ef7 in pthread_join () at /lib64/libpthread.so.0
#1 0x00007fb583abfdc7 in gst_destructor (arg=0x1765e7e0) at
modules/gst/gst.c:423
#2 0x00007fb58e5f54ba in mem_deref (data=0x1765e7e0) at src/mem/mem.c:318
#3 0x000000000040ee95 in audio_set_source (au=au at entry=0x17508140,
mod=mod at entry=0x7ffe4ab103d0 "gst", device=device at entry=0x7ffe4ab103e0
"file:///usr/local/cvd/sip-user-agent/baresip/baresip-0.5.9/empty.mp3")
at src/audio.c:2083
#4 0x00007fb57b1acc30 in switch_audio_device
(session_id=session_id at entry=0x1057f108 "2d3da0e4ddd9fd1f",
device=device at entry=0x0) at modules/robot/robot.c:162
#5 0x00007fb57b1ace0b in switch_audio_device (session_id=0x1057f108
"2d3da0e4ddd9fd1f", device=0x0)
at modules/robot/robot.c:182
#6 0x00007fb58d0417ac in PlayCmd::Action() () at
/usr/local/cvd/sip-user-agent/sip-plugin/build/libsip-plugin.so
#7 0x00007fb58d040367 in TimerProcess() () at
/usr/local/cvd/sip-user-agent/sip-plugin/build/libsip-plugin.so
#8 0x00007fb57b1ac7a9 in plugin_timer_handler (arg=arg at entry=0x0) at
modules/robot/robot.c:238
#9 0x00007fb58e5f389c in tmr_poll (tmrl=tmrl at entry=0x7fb58e815880
<global_re+32>) at src/tmr/tmr.c:113
#10 0x00007fb58e5f4ce8 in re_main (signalh=signalh at entry=0x421c30
<signal_handler>) at src/main/main.c:994
#11 0x000000000040a356 in main (argc=<optimized out>, argv=<optimized out>)
at src/main.c:242
Thanks a lot.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list