[gstreamer-bugs] [Bug 574024] New: [GstAdapter] gst_adapter_push should not accept empty buffers

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Mar 3 19:32:47 PST 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574024

  GStreamer | gstreamer (core) | Ver: git
           Summary: [GstAdapter] gst_adapter_push should not accept empty
                    buffers
           Product: GStreamer
           Version: git
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: vanista at gmail.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Please describe the problem:
When empty buffers are pushed into an adapter, these buffers remain alive until
gst_adapter_clear is called. This can potentially be a runtime leak in filters
which access adapters with take, peek and flush functions, and only clear the
adapter in their reset or finalize functions. For a live streaming application,
this can cause the adapter to grow indefinitely.

Steps to reproduce:
I stumbled on this problem by doing some tests with the fakesrc filter. For
instance, the following pipeline causes a major leak which can quickly use up
all available memory :

gst-launch-0.10 fakesrc ! mpegtsdemux ! fakesink

I recommand using ulimit to prevent a DoS while running this, or be quick to
kill it ;-)



Actual results:
fakesrc pushes buffers with no data, mpegtsdemux adds these buffers to it's
initial adapter then checks for available size. Since all buffers are empty,
the adapter just keeps growing.
If subsequent buffers are not empty and regular take and peek functions are
called, the empty buffers are ignored and remain queued in the adapter.

Expected results:


Does this happen every time?
Yes it's systematic

Other information:
I'm not sure about the odds of encountering empty buffers, but seeing the
udpsrc filter allows receiving empty payloads, I guess it's plausible.

In any case, I think it's conceptually wrong to pile up empty buffers in an
adapter for which the purpose is to provide a fixed number of bytes. These
should be unreffed automatically in the gst_adapter_push function.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574024.




More information about the Gstreamer-bugs mailing list