[Bug 705308] New: Changing the fd property of fdsink is not threadsafe

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Aug 1 10:25:11 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=705308
  GStreamer | gstreamer (core) | 1.x

           Summary: Changing the fd property of fdsink is not threadsafe
    Classification: Platform
           Product: GStreamer
           Version: 1.x
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: gnome at williammanley.net
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


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

Patch - fdsink: Make changing fd property on fdsink thread-safe

Changing the fd property of fdsink is not threadsafe.  This means that you
cannot change the fd from any thread apart from the stream thread if the stream
is currently running.

I've attached a patch that adds the guarantee that when
`g_object_set("fd", x, NULL)` returns the old fd will no longer be in use and
may be closed, etc.

Because a lock is being held across a call to `write` this patch may cause
setting the fd to block for longer than previously unless the fd was
opened with O_NONBLOCK.  This applies to all fds on windows as I guess it
doesn't have an implementation of g_poll.  This doesn't seem so bad as due
to the previous lack of synchronisation aroud `fd` these programs would
have been relying on undefined behaviour anyway but it doesn't make me
entirely happy.

I'll see if I can also come up with a test that exacerbates this issue.

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