App using gstwaylandsink leaks fds

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Thu Mar 26 10:28:39 UTC 2020


Hi,

El mié., 25 mar. 2020 a las 22:50, Nicolas Dufresne
(<nicolas at ndufresne.ca>) escribió:
>
> Le mercredi 25 mars 2020 à 20:28 +0100, Guillermo Rodriguez Garcia a
> écrit :
> > Hello all,
> >
> > I have a minimal app using gstwaylandsink to show video from IP
> > cameras. I found that every time the pipeline is stopped and
> > destroyed, fds are leaked. After some time the application cannot
> > create any fds and fails with a trace similar to this:
> >
> > ERROR> 0:41:16.094958597   584 0xb3ef5b20 ERROR            waylandsink
> > wlshmallocator.c:59:gst_wl_shm_allocator_alloc:<wlshmallocator0>
> > opening temp file /run/xdg/wayland-shm-1644-51WWXP failed: Too many
> > open files
> > ERROR> 0:41:16.095183222   584 0xb3ef5b20 WARN              GST_BUFFER
> > gstbuffer.c:907:gst_buffer_new_allocate: failed to allocate 4 bytes
> > ERROR> (gstplayer:584): GStreamer-CRITICAL **: gst_buffer_memset:
> > assertion 'GST_IS_BUFFER (buffer)' failed
> > ERROR> (gstplayer:584): GStreamer-CRITICAL **: gst_buffer_peek_memory:
> > assertion 'GST_IS_BUFFER (buffer)' failed
> > ERROR> ** (gstplayer:584): CRITICAL **: gst_fd_memory_get_fd:
> > assertion 'mem != NULL' failed
> > ERROR> 0:41:16.095766306   584 0xb3ef5b20 ERROR            waylandsink
> > wlshmallocator.c:211:gst_wl_shm_memory_construct_wl_buffer:<GstWlDisplay at 0xb3e55210>
> > wl_shm_memory: dup failed for fd=-1 (err=-1) mem=(nil)
> >
> > From a quick look at the source code I see that the fds are being
> > allocated in gst_wl_shm_allocator_alloc [1]. But where are they being
> > (/should they be) released?
>
> We do 'gst_buffer_replace (&sink->last_buffer, to_render);' which drop
> reference on last_buffer, and take ownerhsip of to_render.

I see, thank you for the hint!

>
> What GStreamer version is this ? Do you have some information on how to
> reproduce ? I don't face this issue here.

I saw this with 1.14.4. I will try to reproduce it with a more recent
version, and also will try to come up with a minimal sample
reproducing the issue.
Best case I will find the problem during the process. Worst case I
will have something to post here and ask for further help.

Thanks,

Guillermo Rodriguez Garcia
guille.rodriguez at gmail.com


More information about the gstreamer-devel mailing list