Intermittent cygwin heap allocation problem

Cliff Hones cliff@hones.org.uk
Wed Jan 18 14:14:00 GMT 2006


I occasionally see the following heap allocation problem.  This typically happens when a
bash window has been left idle at its prompt for several hours (eg overnight), and occurs
on the first command causing an executable to be run.  It is independent of the command
(as far as I can tell - it has happened with ls, cat, make, ...).  Repeating the command
invariably succeeds, and I am then not troubled again until after another lengthy idle period.

    cliff@CliffW ~
    $ ls
          6 [main] ? (2604) C:\cygwin\bin\bash.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x480000, top 0x4A0000, reserve_size 126976, allocsize 131072, page_const 4096
         98 [main] bash 2160 child_copy: stack write copy failed, 0x22E960..0x230000, done 0, windows pid 2287764, Win32 error 5
    bash: fork: No error

I have seen this (or something very similar) with several versions of the Cygwin DLL, but
haven't reported it before as I find it nothing more than an inconvenience and haven't
researched it myself.  Further, the problem comes and goes suggesting that it is dependent
on the resource state of the Windows OS (and that it could be rather tricky to debug).

It is still present after upgrading to 1.5.19-2.  Searching the mailing list I found
several similar reports, but none mentioning the error occuring on the first invocation
of the day.  I have not tried changing the registry heap_chunk_in_mb setting, which is
mentioned in some reports (I currently have no such key set) as I'm not convinced it's
relevant here.

My setup is W2000+SP4+current updates.  The bash window is a standard cmd window
(and CYGWIN env variable is not set).  cygcheck output attached.

As I said above, this isn't a great concern to me - this isn't a cry for help - but
I am willing to help track the problem down if that is thought useful (and I would
appreciate useful suggestions of how best to do this).  Looking at the Cygwin
source, I see that the error is caused by Windows VirtualAlloc responding with
Invalid Address error, yet the area being allocated (base 480000, top 4a0000, size 128MB)
looks ok to me.  Am I right in thinking this means Windows thinks (part of) this area is
already in use in the forkee?  Presumably not a rebase problem, as it is transitory,
so any ideas as to what can make Windows do this?

-- Cliff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060118/3625a9ad/attachment.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