bash/cygwin leaking process handles

Egor Duda
Mon Dec 4 10:22:00 GMT 2000


Monday, 04 December, 2000 Matt wrote:

M> Anyways, I updated to 1.1.6 and all that good stuff on my NT4 laptop.
M> While I was testing my update to cygcheck, I noticed the bash.exe process
M> had some handles open to non-existant processes. (Using handleex, @
M> ). You can also see this occurring
M> by adding the Handle Count column to Task Manager.

M> This is pretty easy to reproduce:
M> 1. start a fresh bash instance
M> 2. start another bash instance from inside the original instance
M> 3. exit the last bash instance you started
M> 4. repeat.

i   cannot  reproduce  it on my home build dated 2000-11-24. i'm using
Nt  4.0  sp  5.  handle  count  is  stable,  and nthandle utility from
sysinternals  shows  no  new  handles owned  by parent bash process no
matter  how  much  times i repeat. maybe you have something special in
your  ~/.bashrc or ~/.profile? i  know at least one possible reason of
handle  leak  --  ntvdm.exe  opens %SystemRoot%/system32/ega.cpi  each
time    some    dos  program  runs in console window, but never closes
them.  since  ntvdm  is  started  only once per console group, we have
handle  leak.  However,  all  those leaked handles go to ntvdm, not to 
bash, so it doesn't match your description.

anyway,  you  may  want to use nthandle from sysinternals to see, what
those  leaked  handles  really  are -- files, pipes, sockets, etc. And
make  sure  you  have  "clean" environment -- use standard .bashrc and

Btw, what about using sh instead of bash? do sh leaks handles too?

Egor.   ICQ 5165414 FidoNet 2:5020/496.19

More information about the Cygwin-developers mailing list