delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/06/17:50:05

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
Subject: Re: problems with exit codes on 64-bit Windows XP Pro x64
Date: Mon, 06 Feb 2006 14:49:54 -0800
Message-ID: <1649.1139266194@gemini>
From: Kevin Layer <layer AT franz DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

[Interestingly, the text of my message was stripped out... here it is]

I'm running the latest cygwin (1.5.19, see cygcheck below).

My application is a native Windows app (64 and 32-bit).  It includes
no cygwin libraries and is not compiled with cygwin's gcc.  When I
execute cygwin programs from my app, however, the return value
obtained from cygwin programs is always 0.

More precisely, I spawn a particular cygwin program, say `make' or
`sh', with CreateProcess().  When the program exits
GetExitCodeProcess() always sets the exit status to 0, no matter what
the real exit status was.

Attached are 2 programs, exit1.c and bug.c.  Compile with:

cl bug.c bufferoverflowu.lib
cl exit1.c bufferoverflowu.lib

[cl is MS C/C++ version 14, found in the SDK.]

Then, running on 64-bit windows:

  ./bug exit1
  result = 0

Doing the experimentn on 32-bit Windows gets the output

  result = 1

Below are the files.

Is this a known issue?  Any chance of a fix?

-- 
Kevin Layer             layer AT Franz DOT COM        http://www.franz.com/
Franz Inc., 555 12th St., Suite 1450, Oakland, CA  94607, USA
Phone: (510) 452-2000   FAX: (510) 452-0182


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