Here is a simplified example:
$ fd_leaker() { while :; do read a < <(pwd); c=(/proc/$$/fd/*); c=${#c[@]}; echo $c; done; } $ fd_leaker
This is not fixed with /bin/true , but mostly fixed with (exit 0) But I get the error "bash: echo: write error: Interrupted system call" using this fix or if I use /bin/pwd instead of the built-in pwd .
It also looks like read . I tried grep . < <(pwd) > /dev/null grep . < <(pwd) > /dev/null and it worked correctly. When I tried while read a; do :; done < <( pwd) while read a; do :; done < <( pwd)
Additional file descriptors in the form:
lr-x------ 1 user user 64 2010-04-15 19:26 39 -> pipe:[8357879]
I really do not think that their unbridled creation is intended, because nothing recursive happens there. I really don't see how adding something to the loop should fix it.
source share