[Bug 773532] The segfault happens when many clients work with rtsp server with GST_RTSP_LOWER_TRANS_TCP option on.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Oct 27 11:06:09 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=773532

Kseniya Vasilchuk <vasilchukkseniia at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #338507|needs-work                  |none
             status|                            |
 Attachment #338507|0                           |1
        is obsolete|                            |

--- Comment #3 from Kseniya Vasilchuk <vasilchukkseniia at gmail.com> ---
Created attachment 338601
  --> https://bugzilla.gnome.org/attachment.cgi?id=338601&action=edit
new patch

> GWeakRef only works on GObjects, this can't work here (also allocate it
> directly inside the struct instead of using another g_new() here)

Why not? We have 3 cases of using "gst_rtsp_stream_transport_set_callbacks":

    1) gst_rtsp_stream_transport_set_callbacks (trans,
        (GstRTSPSendFunc) do_send_data,
        (GstRTSPSendFunc) do_send_data, client, NULL); with GstRTSPClient

    2) gst_rtsp_stream_transport_set_callbacks (context->stream_transport,
        GstRTSPSendFunc) do_send_data,
        GstRTSPSendFunc) do_send_data, context, NULL); with
GstRTSPStreamContext

    and

    3) gst_rtsp_stream_transport_set_callbacks (trans, NULL, NULL, NULL, NULL);

GstRTSPClient and GstRTSPStreamContext are both GObjects, NULL is just a NULL.

I've added an assertion in new patch that checks that user_data is a GObject.
And I've changed the allocator as you said.

> This should probably be solved differently somehow, either by using a mutex
> or by ensure that the callback is removed early enough.

I thought about unsetting callbacks, but I don't know how to guarantee that
"do_send_data" won't be in progress (even after unsetting callbacks) at the
time of client finalizing.
And if mutex should be used, where should it be placed? Can we protect
send_rtp, send_rtcp and set_callbacks functions by mutex? Will it work fast
enough?

-- 
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