-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource leak when subprocess_create_ex()
fails
#85
Comments
The following is helpful (at least on Linux) for debugging this (see https://developers.redhat.com/articles/2023/01/09/how-use-valgrind-track-file-descriptors#valgrind___track_fds_yes): valgrind -q --tool=none --track-fds=yes |
(Note - found out the hard way if you forget to call subprocess_destroy, fd leaks - even in normal usage - are one of the symptoms) |
Thanks for the report. Super busy at the moment but when I get the time I'll take a look! |
The
subprocess_create_ex()
function just hasreturn -1
in case of an error, without properly closing already open file descriptors.Example:
subprocess.h/subprocess.h
Lines 876 to 880 in 7e59b69
In my test, trying to call this function with a non-existing command results in 6 more new FDs each time.
The text was updated successfully, but these errors were encountered: