X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <490855B2.90502@razorcat.de>
Date: Wed, 29 Oct 2008 13:23:14 +0100
From: Frank Redeker <f.redeker@razorcat.de>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: bash: Strange behavior when a program crashes
Content-Type: multipart/mixed;  boundary="------------090906000401000704040902"
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

--------------090906000401000704040902
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Operating System:

Windows XP SP 3 with DEP enabled

$ uname -a
CYGWIN_NT-5.1 TYR 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

$ bash --version
GNU bash, version 3.2.39(20)-release (i686-pc-cygwin)
Copyright (C) 2007 Free Software Foundation, Inc.


When I execute a non-cygwin executable from the bash and the program
crashes with an exception raised (e.g. access violation), the bash
doesn't return immediately. Instead the crashed program is executed 4
more times before the bash finally returns.


This behavior is reproducible with the attached code compiled with the
free Borland compiler.

If the example is executed, the output of `fprintf` is only shown once,
but the messagebox is shown 5 times.


Any ideas?


Frank

--------------090906000401000704040902
Content-Type: text/plain;
 name="crash.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="crash.c"

#include <windows.h>
#include <stdio.h>

int main (int argc, char ** argv) {
	/* show we are running */
	fprintf (stderr, "This is crash!\n"); fflush (stderr);
	MessageBox (0, "This is crash!", "crash", MB_YESNO);
	/* force exception */
	return *((int *) 0) = 0;
}


--------------090906000401000704040902
Content-Type: text/plain; charset=us-ascii

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