[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash leaks sh-np-NNN files and pipes in /tmp/ when command substitution
bash leaks sh-np-NNN files and pipes in /tmp/ when command substitution is used
Tue, 10 Dec 2013 23:29:37 -0800
Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
Some of my scripts use command substitution, and now I see that there
are lots of files like these in /tmp:
prw------- 1 yuri wheel 0 Dec 10 13:32 sh-np-1386738492
-rw-r--r-- 1 yuri wheel 3278909 Dec 10 14:54 sh-np-1386721176
Besides the obvious question why they aren't deleted in the end, two
Shouldn't bash delete the pipe files once the child process opened them?
On most platforms the deleted pipe will function the same with the
benefit that it will get deleted automatically.
Why some of he files /tmp/sh-np-NNN are regular files, not pipes? When I
look through code I see mkfifo call creates them. Shouldn't it always
create fifos and not files?