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...@]}

File descriptor leak in nested functions

2010-04-16 Thread Charles Duffy
c-linux-gnu Bash Version: 4.0 Patch Level: 33 Release Status: release Description: File descriptor leak in nested functions Repeat-By: Run the following code: function get_fd_count() { local fds cd /proc/$$/fd; fds=( * ) # avo

Re: File descriptor leak in nested functions

2010-04-16 Thread Charles Duffy
2 > -Wall > uname output: Linux cduffyxp 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 > 04:38:19 UTC 2010 x86_64 GNU/Linux > Machine Type: x86_64-pc-linux-gnu > > Bash Version: 4.0 > Patch Level: 33 > Release Status: release > > Description: > File descriptor leak in