Re: File descriptor leak in nested functions

2010-04-18 Thread Chet Ramey
On 4/18/10 1:33 AM, Dennis Williamson wrote: > For those who might be interested, here's a much simpler function that > exhibits the same kind of leak and doesn't involve nested functions. > > fd_leaker() { while :; do read a < <(pwd); c=(/proc/$$/fd/*); > c=${...@]}; echo $c; done; } > > For som

Re: File descriptor leak in nested functions

2010-04-17 Thread Dennis Williamson
For those who might be interested, here's a much simpler function that exhibits the same kind of leak and doesn't involve nested functions. fd_leaker() { while :; do read a < <(pwd); c=(/proc/$$/fd/*); c=${...@]}; echo $c; done; } For some reason, adding "(exit 0); " right before the "done" seems

Re: File descriptor leak in nested functions

2010-04-17 Thread Chet Ramey
On 4/15/10 6:58 PM, Charles Duffy wrote: > The provided reproducer was unnecessarily complicated. The following also > reproduces the issue: > > function get_fd_count() { > local fds > cd /proc/$$/fd; fds=( * ) # avoid a StackOverflow source colorizer bug > echo "${#f...@]}

Re: File descriptor leak in nested functions

2010-04-16 Thread Charles Duffy
The provided reproducer was unnecessarily complicated. The following also reproduces the issue: function get_fd_count() { local fds cd /proc/$$/fd; fds=( * ) # avoid a StackOverflow source colorizer bug echo "${#f...@]}" } function fd_leak_func() { while : ; do