Eric Wong wrote on Tue, Feb 01, 2022 at 11:27:40PM +0000:
> Is nix-shell setting FD_CLOEXEC on all FDs (>= 3) it creates?
> IMNSHO it should.

ugh, it definitely should -- in this case it looks like a plain fd
leak.

$ ls -l /proc/$$/fd/
total 0
lrwx------ 1 asmadeus users 64 Feb  2 09:17 0 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 1 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 2 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 255 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 4 -> '/tmp/nix-shell.vhDsb9 
(deleted)'
$ ls -l /proc/self/fd/
total 0
lrwx------ 1 asmadeus users 64 Feb  2 09:17 0 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 1 -> /dev/pts/28
lrwx------ 1 asmadeus users 64 Feb  2 09:17 2 -> /dev/pts/28
lr-x------ 1 asmadeus users 64 Feb  2 09:17 3 -> /proc/1220800/fd
lrwx------ 1 asmadeus users 64 Feb  2 09:17 4 -> '/tmp/nix-shell.vhDsb9 
(deleted)'

nix-shell/nix shell don't seem to have the problem it's a 'nix develop'
bug, I'll follow it up with nix devs and get it fixed there.
(I don't have an opinion if you want to make your tests more robust, it
might be a good thing in general anyway)

Thanks for figuring this out!
-- 
Dominique

Reply via email to