delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/22/08:03:56

X-Spam-Check-By: sourceware.org
Date: Wed, 22 Nov 2006 14:03:38 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygheap base mismatch detected - only on Vista x64, not seen on Vista x86
Message-ID: <20061122130338.GF8333@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <09BFF2FA5EAB4A45B6655E151BBDD903093BAF AT NT-IRVA-0750 DOT brcm DOT ad DOT broadcom DOT com>
Mime-Version: 1.0
In-Reply-To: <09BFF2FA5EAB4A45B6655E151BBDD903093BAF@NT-IRVA-0750.brcm.ad.broadcom.com>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Nov 17 18:29, Joseph Koenig wrote:
> DISCLAIMER: Yes, I realize Vista is not officially supported. If anything I hope this e-mail will end up in the archives to prevent other uses who see this same problem from wasting time if there is no war available. 
> 
> I have successfully used cygwin on Vista32 with no problems. 
> On Vista64 I can complete the install but I have errors when I try to execute basic commands, such as ls.
> This is with Vista RTM.
> 
> Some useful info:
> The error message:: I actually receive this several times at various entry points to main, but I'll just paste it once:
> 
> bash-3.2$ ls
>       5 [main] ? (1376) D:\cygwin\bin\bash.exe: *** fatal error - cygheap base m
> ismatch detected - 0x0/0x611828F0.
> This problem is probably due to using incompatible versions of the cygwin DLL.
> Search for cygwin1.dll using the Windows Start->Find/Search facility
> and delete all but the most recent version.  The most recent version *should*
> reside in x:\cygwin\bin, where 'x' is the drive on which you have
> installed the cygwin distribution.  Rebooting is also suggested if you
> are unable to find another cygwin DLL.
>       3 [main] bash 2032 fork: child -1 - died waiting for longjmp before initia
> lization, retry 0, exit code 0x100, errno 11
> bash: fork: Resource temporarily unavailable

I have mixed news on this issue.  The good news is, it's quite easy to
reproduce since it occurs all the time, so I started to debug this.  The
bad news is that I have no idea why happens what happens.

What happens is this:

Basically, when forking a process Cygwin calls CreateProcess, starting
the current application another time and then parent and child fiddle
with the shared handles and memory to give the child an up-to-date,
forked-like outfit.

This however requires a way to propagate information to the child process
which allows the child to do certain actions at a very early stage of
initialization.  The way to do this is to utilize the STARTUPINFO given
to the CreateProcess call.  One parameter in there is called lpReserved2,
which is, for instance, also used by the MSVCRT C runtime library to
propagte information to child processes.

Well, we are our own C runtime.  Cygwin processes are not linked against
MSVCRT for that reason, so it's safe to use lpReserved2 for our own,
dubious purposes.  The child calls the GetStartupInfo function and gets
all information needed.

Not so under Vista x64.  The child calls GetStartupInfo and gets a valid
result, with an apparently also valid lpReserved2 pointer.  At least the
pointer points to something valid within the child's address space.
Unfortunately, what it points to is only filled with zeros.  The information
expected at this point is just not there anymore.  This in turn leads
to the above result.

So far I know that it has nothing to do with being started by a 64 bit
process and I also know that this is not a generic problem with the
lpReserved2 member in Vista WOW64 processes. as a simple testcase(tm)
showed.

So, as for the why... I'm quite puzzeled.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


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