You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: linux: the RTMP socket and the QSV DRM fd leak into child processes (follow-up of #2278) #2305
Found while fixing #2278 (the Virtual Camera fd leaked into the recording muxer). Other descriptors that obs-rust holds open, without close-on-exec, while it spawns child processes such as obs-ffmpeg-mux:
The RTMP stream socket:shared/happy-eyeballs/hosts/posix/happy-eyeballs-platform.h around line 42 creates it without SOCK_CLOEXEC. A recording started while streaming gives the muxer a copy of the stream's TCP connection, which then outlives the stream in the child until the recording ends.
The QSV encoder's DRM fd on Linux:plugins/obs-qsv11/common_utils_linux.cpp.hpp around line 291 opens it without O_CLOEXEC and holds it while encoding. Line 384 is the QSV probe open, with the same flags but short-lived.
Failure-path leaks:
vaapi_open_display_drm() leaves *fd open when vaGetDisplayDRM() returns NULL;
qsv11 has the same pattern around line 297.
Plan
RED:
Open each descriptor through the real code path, and assert FD_CLOEXEC. A loopback TCP connection is enough for happy-eyeballs; a temp file or render node, with a skip, for QSV.
Spawn a child with os_process_pipe_create(), and assert the descriptor is not in /proc/<child>/fd.
Exercise the failure paths and assert no fd is left open.
GREEN: add SOCK_CLOEXEC / O_CLOEXEC, and close on the failure paths.
Activity
rdoupe commentedon Oct 25, 2026
Claiming: #2305.
test: RTMP socket and QSV device leak into children
happy-eyeballs, qsv11: Open close-on-exec
Keep the RTMP socket and QSV fd out of children (obs-rust#2310)