public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bash: Strange behavior when a program crashes
@ 2008-10-29 12:22 Frank Redeker
  2008-10-29 12:29 ` Greg Chicares
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Redeker @ 2008-10-29 12:22 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

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

[-- Attachment #2: crash.c --]
[-- Type: text/plain, Size: 266 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bash: Strange behavior when a program crashes
  2008-10-29 12:22 bash: Strange behavior when a program crashes Frank Redeker
@ 2008-10-29 12:29 ` Greg Chicares
  2008-10-29 12:53   ` Frank Redeker
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Chicares @ 2008-10-29 12:29 UTC (permalink / raw)
  To: cygwin

On 2008-10-29 12:23Z, Frank Redeker wrote:
> 
> 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.

It's a feature:
  http://sourceware.org/ml/cygwin/2008-03/msg00592.html

'set CYGWIN=proc_retry:1':
  http://sourceware.org/ml/cygwin/2008-03/msg00595.html

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bash: Strange behavior when a program crashes
  2008-10-29 12:29 ` Greg Chicares
@ 2008-10-29 12:53   ` Frank Redeker
  2008-10-29 13:08     ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Redeker @ 2008-10-29 12:53 UTC (permalink / raw)
  To: cygwin

Greg Chicares schrieb:
> On 2008-10-29 12:23Z, Frank Redeker wrote:
>> 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.
> 
> It's a feature:
>   http://sourceware.org/ml/cygwin/2008-03/msg00592.html
> 
> 'set CYGWIN=proc_retry:1':
>   http://sourceware.org/ml/cygwin/2008-03/msg00595.html
> 
> --
> 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/
> 
> 

Setting the CYGWIN environment variable don't work here. Did i make any
mistake.

$ echo $CYGWIN
proc_retry:1

Frank

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: bash: Strange behavior when a program crashes
  2008-10-29 12:53   ` Frank Redeker
@ 2008-10-29 13:08     ` Dave Korn
  2008-10-29 13:25       ` Frank Redeker
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2008-10-29 13:08 UTC (permalink / raw)
  To: cygwin

Frank Redeker wrote on 29 October 2008 12:54:

> Setting the CYGWIN environment variable don't work here. Did i make any
> mistake.
> 
> $ echo $CYGWIN
> proc_retry:1

  Looks right to me, but maybe it's one of those ones like (no)tty that you
have to specify in your windows environment before any cygwin processes are
launched.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bash: Strange behavior when a program crashes
  2008-10-29 13:08     ` Dave Korn
@ 2008-10-29 13:25       ` Frank Redeker
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Redeker @ 2008-10-29 13:25 UTC (permalink / raw)
  To: cygwin

Dave Korn schrieb:
> Frank Redeker wrote on 29 October 2008 12:54:
> 
>> Setting the CYGWIN environment variable don't work here. Did i make any
>> mistake.
>>
>> $ echo $CYGWIN
>> proc_retry:1
> 
>   Looks right to me, but maybe it's one of those ones like (no)tty that you
> have to specify in your windows environment before any cygwin processes are
> launched.
> 
> 
>     cheers,
>       DaveK

Thx for the hint, Dave, not it works. :)


Frank

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-29 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-29 12:22 bash: Strange behavior when a program crashes Frank Redeker
2008-10-29 12:29 ` Greg Chicares
2008-10-29 12:53   ` Frank Redeker
2008-10-29 13:08     ` Dave Korn
2008-10-29 13:25       ` Frank Redeker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).