[Bug 775014] New: v4l2src buffer leak, race condition sending EOS from another thread

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Nov 24 14:58:47 UTC 2016


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

            Bug ID: 775014
           Summary: v4l2src buffer leak, race condition sending EOS from
                    another thread
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: p.zabel at pengutronix.de
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 340686
  --> https://bugzilla.gnome.org/attachment.cgi?id=340686&action=edit
v4l2src: release buffer if create fails

If a v4l2src is sent an EOS event from another thread, the buffer pool is set
to flushing/inactive.
If at the same time the v4l2src thread is blocking on a DQBUF poll in
gst_v4l2src_create, it continues to run and may acquire a buffer. In that case
it will call gst_v4l2_buffer_pool_process with the pool already inactive.
gst_v4l2_buffer_pool_process throws a critical error message and returns
GST_FLOW_ERROR, and then gst_v4l2src_create just returns that error without
decrementing the buffer refcount. The returned buffer is then ignored by
gst_base_src_get_range due to the error return value.

The observed result is that when repeatedly starting and stopping a pipeline
this way, sometimes gst_v4l2src_stop is not called due to the outstanding
buffer that is never returned, the v4l2 queue doesn't free its buffers, and
during the next stream start the REQBUFS fails with -EBUSY.

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