delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/06/16:21:07

Date: Thu, 6 Apr 2000 13:33:01 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Peter J. Farley III" <pjfarley AT banet DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Possible bash v2.03 file handle leak?
In-Reply-To: <38ec08c9.9897979@news3.banet.net>
Message-ID: <Pine.SUN.3.91.1000406132119.3003M-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 6 Apr 2000, Peter J. Farley III wrote:

> Details:  I'm helping with Andy Sumner's Awka project (see below for
> website info) by configuring and testing under DJGPP for him.  His
> latest beta makes cleanly under DJGPP v2.03, but the "make check"
> suite fails at the next-to-last test in the suite when using the
> latest release of bash v2.03.  The entire "make check" suite seems to
> work fine when run with a slightly earlier release of bash v2.03.

This doesn't prove that Bash has a bug.  It might well be that the test 
uses up all the file handles on your system, and the earlier Bash 
succeeds because it uses less handles in its routine operation.

To dig into this, I'd suggest to run the test suite under GDB.  That is, 
download Bash sources, build it with -g and without -s, and then run it
from GDB and invoke the script(s).

Once you have this setup working, you need first to verify that the 
problem doesn't disappear when you run from GDB. ;-)

With that out of your way, put a breakpoint inside the function which 
reports the error you see when the script fails.  When the breakpoint is 
hit, examine the file handles open by Bash, e.g., by calling fflush for 
each handle from GDB's command line.  Handles which return 0 are still 
open, those which return -1 are not.  This will tell you how many handles 
does Bash have open.  You want to prove that it has all 254 of them used 
up.

> My environment is Win98(SE) DOS box, LFN=Y.  Awka is not LFN-clean
> yet, so making it under plain DOS is not an option at this time.  I do
> NOT have FILES= in my CONFIG.SYS, which under Win98(SE) is *supposed*
> to mean that the system automatically provides FILES=127 as a default.

It might be useful to write a simple program to verify that claim (I 
suspect that quite a few of the handle are taken up by Windows).  I 
suggest to read section 9.7 of the FAQ for some insight, *before* you 
write the test program.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019