Open wn2000 opened 4 months ago
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: https://github.com/sheredom/subprocess.h/blob/7e59b6924aa0e1a595be86fdeb1d4c28835aa0b9/subprocess.h#L876-L880
In my test, trying to call this function with a non-existing command results in 6 more new FDs each time.