gst_element_set_state (ELEm, GST_STATE_NULL) causes a deadlock
Describe your issue
Dynamically deleting streams occasionally triggers deadlocks. Location is gst_element_set_state (elem, GST_STATE_NULL); I found similar problems, but no solutions. The stack information:
#0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1 0x00007fdf37ad90f4 in __GI___pthread_mutex_lock (mutex=0x7fdb340013d0) at ../nptl/pthread_mutex_lock.c:115
#2 0x00007fdf3940e87f in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#3 0x00007fdf3940f335 in gst_pad_set_active () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#4 0x00007fdf393ecf0d in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#5 0x00007fdf393ff884 in gst_iterator_fold () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#6 0x00007fdf393eda16 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#7 0x00007fdf393ef95e in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#8 0x00007fdf393efc06 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#9 0x00007fdf39713365 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
#10 0x00007fddfade1f41 in gst_v4l2_video_dec_change_state () from target:/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so
#11 0x00007fdf393f1d5e in gst_element_change_state () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#12 0x00007fdf393f2499 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#13 0x00007fdf393cfa02 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#14 0x00007fdf23e50029 in ?? () from target:/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#15 0x00007fdf393f1d5e in gst_element_change_state () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#16 0x00007fdf393f2499 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#17 0x00007fdf393cfa02 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#18 0x00007fdf23e6369a in ?? () from target:/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#19 0x00007fdf393f1d5e in gst_element_change_state () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#20 0x00007fdf393f2499 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#21 0x00007fdf393cfa02 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#22 0x00007fdf393f1d5e in gst_element_change_state () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#23 0x00007fdf393f2045 in gst_element_change_state () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#24 0x00007fdf393f2499 in ?? () from target:/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#25 0x0000559350e1e5b2 in stop_release_source(NvDsSrcParentBin*, int) ()
#26 0x0000559350e1f295 in event_thread_func_2(void*) ()
#27 0x00007fdf38e75e23 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fdf38e753a5 in g_main_context_dispatch () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fdf38e75770 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fdf38e75a82 in g_main_loop_run () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x0000559350e21e92 in main ()
Expected Behavior
I want a dynamic delete stream.
Setup
- Operating System: ubuntu
- Device: Computer
- GStreamer Version: 1.14.5
- Command line: ./deepstream-test5-app -c configs/test5_config_file_src_infer.txt
Steps to reproduce the bug
- state_return = gst_element_set_state (elem, GST_STATE_NULL);
- sinkpad = gst_element_get_static_pad (bin->streammux, pad_name); gst_pad_send_event (sinkpad, gst_event_new_flush_stop (FALSE)); gst_element_release_request_pad (bin->streammux, sinkpad);
- gst_object_unref (sinkpad); gst_bin_remove (GST_BIN (pipeline), elem);
How reproducible is the bug?
Intermittent
Screenshots if relevant
Solutions you have tried
Related non-duplicate issues
Additional Information
Edited by Nirbheek Chauhan