Some new data regarding "fork: resource temporarily unavailable"

David Arnstein arnstein@pobox.com
Sun Nov 6 05:23:00 GMT 2005


Synopsis:
the "fork: resource temporarily unavailable" problem may be caused
by a large number of obsolete process handles.

Attached to this e-mail:
1.  cygcheck.out:
the output from "cygcheck -s -v -r"
2.  tempor.sh:
A bash shell script that causes the "fork: resource temporarily
unavailable" problem on my computer. This script searches for
identical files by brute force: it launches cmp.exe many times.

First, I ran the standard Windows Task Manager with a non-standard
column shown: handle count. I noticed something disturbing
immediately. There is a process (pseudo process?) named
"System." What I see on my computer is that for this process,
the handle count rises slowly but continuously. This occurs when
my computer is almost idle (I have several daemon type processes
running, so the machine is never completely idle). If I launch any
program, the handle count jumps up. After terminating the program,
the handle count does NOT reduce.

Next, I launched "Process Explorer" which is distributed from
http://www.sysinternals.com. This program allows me to examine the
handles owned by the "System" process. What I found is that most of
the handles are Process handles. These handles have names of the form
	<Non-existent Process> (nnnn)
where nnnn is a three to five digit number.

Finally, I ran the attached shell script "tempor.sh." Specifically, I
opened a Cygwin command window and, at the bash shell prompt, I typed
	cd C:/Windows/System32
	tempor.sh *

This caused tempor.sh to process 2,302 files. This in turn caused
tempor.sh to launch cmp.exe more than 2.5 million times.

When tempor.sh started, the number of handles owned by the "System"
process was less than 10,000.  While tempor.sh was running, I
watched the status of the "System" process in the Windows Task
Manager. As expected, I saw the "handles" count for this process
rise continuously and rather quickly: very roughly, 30 units per
second. My computer's CPU was 50% to 75% busy at the time.

After many minutes, tempor.sh halted itself with the by-now familiar
message "fork: resource temporarily unavailable." The number of
handles owned by the "System" process was about 86,000.

It appears that Windows itself has a problem clearing out old
Process handles from some operating system table. It looks like a
problem not specific to Cygwin at all.  I admit that the evidence
I present is not conclusive. Nevertheless, the fact that there is
a boundlessly increasing allocation of a resource (process handles)
looks suspiciously like breakage to me.

Would someone please suggest a forum (or book) where I can pursue
this further. I would like to try to clear out the old handles,
the ones with names like
	<Non-existent Process> (nnnn)
as referenced in "Process Explorer."

Thank you for any suggestions!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20051106/5663209f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tempor.sh
URL: <http://cygwin.com/pipermail/cygwin/attachments/20051106/5663209f/attachment-0001.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list