[gstreamer-bugs] [Bug 352345] New: Small race condition in the queue element

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Aug 22 00:54:00 PDT 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=352345
 GStreamer | gstreamer (core) | Ver: 0.10.x

           Summary: Small race condition in the queue element
           Product: GStreamer
           Version: 0.10.x
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: sjoerd at luon.net
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Hi,

  I ran into a small race condition in the queue element today. I'm using a
queue with just place for one buffer that's leaky downstream. Currently the
queue does the following to detect/handle that it's full:

 while (gst_queue_is_filled (queue)) {
    GST_QUEUE_MUTEX_UNLOCK (queue);
    g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_OVERRUN], 0);
    GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);

While emitting the signal, the queue is not locked. So the loop task can take
buffers from the queue. With a one place buffer this means that when the queue
is locked again, which triggers an assertion in the downstream leak code.

I'll attach a patch that fixes this by rechecking if we have a full queue when
the queue is locked again. Note that this slightly changes the semantics of the
overrun signal in case of a leaky queue.. Currently it means that the queue was
full and a buffer *is* dropped, with this patch it means that a buffer *might*
be dropped

Probably a better fix would be to only signal overrun after dropping (or just
before blocking), but that requires more changes then i had time for.

  Sjoerd


-- 
Configure bugmail: http://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