This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bash: Strange behavior when a program crashes


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
#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;
}

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]