[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File descriptor leak in nested functions
From: |
Dennis Williamson |
Subject: |
Re: File descriptor leak in nested functions |
Date: |
Sun, 18 Apr 2010 00:33:05 -0500 |
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=${#c[@]}; echo $c; done; }
For some reason, adding "(exit 0); " right before the "done" seems to
limit the creation of extra file descriptors.
The problem seems to be related to read and subshells.
On Sat, Apr 17, 2010 at 10:17 PM, Chet Ramey <chet.ramey@case.edu> wrote:
>
> Thanks for the report. This will be fixed in the next release of bash.
>
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
>
>