App using gstwaylandsink leaks fds

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Wed Mar 25 19:28:50 UTC 2020


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?

I need to dig further into this, but I'm not familiar with how this
works -- any hints would be welcome.

 [1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/wayland/wlshmallocator.c#L40
-- 
Guillermo Rodriguez Garcia
guille.rodriguez at gmail.com


More information about the gstreamer-devel mailing list