delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/05/26/02:02:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 26 May 2011 08:02:02 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin 1.7.x on Windows 7: Exit statuses of Win32 executables are sometimes wrong
Message-ID: <20110526060202.GW848@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <0C817B08-1920-43DB-B9A0-26E4B2E362EA AT apple DOT com>
MIME-Version: 1.0
In-Reply-To: <0C817B08-1920-43DB-B9A0-26E4B2E362EA@apple.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
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 Apr 29 11:35, John Dong wrote:
> Hi,
> 
> Cygwin on Windows 7, seems to exhibit a rather peculiar behavior: Sometimes the exit status of a Win32 process is incorrectly captured by Cygwin.

Please:

http://cygwin.com/acronyms/#PCYMTWLL
http://cygwin.com/acronyms/#TOFU


> [...]
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > 	int ret = _ttoi(argv[1]);
> > 	_tprintf(_T("Exiting with %i\n"), ret); 
> > 	
> > 	return ret;
> > }
> 
> Then, I wrote a shell script that called this executable ("exiter.exe") with argument 0 in an infinite loop:
> 
> > #!/bin/sh
> > set -e
> > while true; do
> >  /cygdrive/c/exiter.exe 0
> > echo $?
> > done
> > 
> 
> I expect this script to run forever, as the exit code should always be zero. However, after running this overnight, I see the script terminate:
> 
> > Exiting with 0
> > 0
> > Exiting with 0
> > 
> > $ echo $?
> > 1
> > 

I'm running your testcase on a W7 32 bit machine for about 12 hours now,
and it's still running.  The only difference is that I built exiter.exe
using MingW gcc, rather than VC++, but that doesn't change the fact that
the resulting application is a native one.

Did any of you running into this problem check if this could be a BLODA
problem(*)?


Corinna

(*) http://cygwin.com/faq/faq.using.html#faq.using.bloda

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

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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