X-Spam-Check-By: sourceware.org
Date: Wed, 18 Jan 2006 11:08:45 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Intermittent cygwin heap allocation problem
Message-ID: <20060118160845.GA15870@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <43CE4834.1010702@hones.org.uk> <SERRANOgjHXwKHvyo3D000001af@SERRANO.CAM.ARTIMI.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <SERRANOgjHXwKHvyo3D000001af@SERRANO.CAM.ARTIMI.COM>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Wed, Jan 18, 2006 at 03:16:27PM -0000, Dave Korn wrote:
>Cliff Hones wrote:
>> [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
>> [main] bash 2160 child_copy: stack write copy failed, 0x22E960..0x230000, done 0, windows pid 2287764, Win32 error 5 bash: fork: No error  
>
>>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?
>
>
>It is, as you guessed, already in use.
>
>It relates to the little bit of extra data that cygwin keeps in memory
>allocated immediately after each .dll that is loaded in an image.
>
>The code that allocates these is flexible, and if it can't allocate
>space immediately after the dll it will work its way up in memory until
>it succeeds.

Actually, this kind of error is more likely to be caused by a thread starting
prior to cygwin initialization and grabbing cygwin's heap area to use for its
stack.  I moved things around a bit in 1.5.19 to try to avoid that but I guess
it was for naught.

cgf

--
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/

