[Bug 737110] New: race condition when closing client connextion

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Sep 22 04:46:59 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=737110
  GStreamer | gst-rtsp-server | git

           Summary: race condition when closing client connextion
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-rtsp-server
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: ognyan.tonchev at axis.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=286804)
 View: https://bugzilla.gnome.org/attachment.cgi?id=286804
 Review: https://bugzilla.gnome.org/review?bug=737110&attachment=286804

rtsp-client: do not free main context before rtsp watch

There is a rare race condition which can lead to a crash when closing the
connection. The problem is basically that the clients main context can be freed
before/while the rtsp watch is destroyed:

gst_rtsp_client_close () drops all references to the rtsp watch by calling
g_source_destroy() and g_source_unref(). Which on the other hand will trigger
GLib to call the GSource finalize function, client_watch_notify().

client_watch_notify() drops the ref to the main context owned by the client
object and emits the CLOSED signal.

This will result in a call to unmanage_client() in the server object.
unmanage_client() adds an idle source which among other things will drop the
last ref to the client main context.

Most of the time the idle source is scheduled after client_watch_notify()
returns and g_source_unref_internal () has finished using the context mutex.
But the source can also be dispatched while g_source_unref_internal () is still
not done.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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