[Bug 751440] New: gst_debug_remove_log_function exposes a potential race condition w. LogFuncEntry's user_data/notify

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Jun 24 06:27:09 PDT 2015


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

            Bug ID: 751440
           Summary: gst_debug_remove_log_function exposes a potential race
                    condition w. LogFuncEntry's user_data/notify
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: hfink at toolsonair.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

In gst/gstinfo.c, gst_debug_remove_with_compare_func copies and leaks the list
__log_functions in order to avoid locking in gst_debug_log_valist to make it
thread-safe. However, gst_debug_remove_with_compare_func also executes the
destroy-notifier on the LogFuncEntry's user_data, and this could actually still
be used by a logging action while it is deleted.

To make this fully thread-safe, we could use a reader/writer lock ("shared"
mutex), where the gst_debug_log_valist acquires a read-lock, and the add/remove
functions of the debug handler acquire a write-lock.

With the current implementation, we should at least document that
gst_debug_remove_log_function and gst_debug_remove_log_function_by_date are not
thread-safe (with respect to the user-data of installed log functions).

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