The segfault happens when many clients work with rtsp server with GST_RTSP_LOWER_TRANS_TCP option on.
Submitted by Kseniya Vasilchuk
Link to original bug (#773532)
Description
Created attachment 338506
stacktrace
I've added a stacktrace of segfault in attachment.
As you can see from it, the segfault happens inside "do_send_data" function mutex lock, and "do_send_data" function calls from "gst_rtsp_stream_transport_send_rtp" function.
So the reason of segfault is that GstRTSPClient finalizing happens before or in the time of "do_send_data" work. So "do_send_data" uses already destroyed client mutex.
I've made a patch to fix that problem. Please review it.
P.S. To reproduce this bug I took rtsp server from examples (test-readme.c) and add next line to it:
gst_rtsp_media_factory_set_protocols (factory, GST_RTSP_LOWER_TRANS_TCP);
Then I used many clients that were connected/disconnected simultaneously. Also I added sleep(1) inside "gst_rtsp_stream_transport_send_rtp" to reproduce it more often.
Attachment 338506, "stacktrace":
segfault_stacktrace.txt
Version: 1.8.2