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
Those file handles should not be leaking into child processes like that. Such leakage can be problematic:
At best, it keeps a useless file handle open in the subprocess, which can be a problem in situations where a user might be approaching /proc/sys/fs/file-max or ulimit -n
At worst, the child process could unexpectedly write to one of those handles due to a bug or a compulsive desire to enumerate all open files for some reason.
If your home directory is on NFS, holding the file handle open can do weird things like prevent the deletion of that directory.
The lock files are particularly worrisome as leaking those into child processes could result in unexpected behavior if the child process outlives the server process (e.g. launching a tmux session or an ipython server with nohup).
It would appear that at least some files aren't being opened with O_CLOEXEC. It's very rare that opening files without O_CLOEXEC is a good idea in linux (Python has made this the default since 3.4 and I believe that in Windows you have to go pretty far out of the way to have a child inherit a file handle)
The text was updated successfully, but these errors were encountered:
Agree that this is very annoying. I spent an entire night trying to figure out why one of my program that heavily relies on input FD set produced weird alert in VsCode. Moreover, valgrind --track-fds=yes produced bogus alerts, breaking my autotest suite that assumes no non-std open fds on exit.
==31806==
==31806== FILE DESCRIPTORS: 6 open (3 std) at exit.
==31806== Open file descriptor 103: /opt/vscodium-bin/v8_context_snapshot.bin
==31806== <inherited from parent>
==31806==
==31806== Open file descriptor 38: /opt/vscodium-bin/resources/app/node_modules.asar
==31806== <inherited from parent>
==31806==
==31806== Open file descriptor 36: /home/lz/.config/VSCodium/logs/20240121T003220/ptyhost.log
==31806== <inherited from parent>
Previously it was closed in #58814 as 'Not a security issue', but at least this is an annoying bug.
As for fix, we can either do the right thing by applying O_CLOEXEC when opening these fds, or VsCode could use something like closeInheritedFds to close all unwanted fds before spawning the terminal process
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
sleep 600
.ls -l /proc/<n>/fd
I see the following (slightly redacted) list of file handles open in the child process:
Those file handles should not be leaking into child processes like that. Such leakage can be problematic:
/proc/sys/fs/file-max
orulimit -n
tmux
session or anipython
server withnohup
).It would appear that at least some files aren't being opened with
O_CLOEXEC
. It's very rare that opening files withoutO_CLOEXEC
is a good idea in linux (Python has made this the default since 3.4 and I believe that in Windows you have to go pretty far out of the way to have a child inherit a file handle)The text was updated successfully, but these errors were encountered: