public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Bill Smith <bsmith@progress.com>
To: "Brian.Inglis@Shaw.ca" <Brian.Inglis@Shaw.ca>,
	"cygwin@cygwin.com"	<cygwin@cygwin.com>
Subject: RE: Cygwin shell eats Windows exceptions?
Date: Thu, 13 Oct 2016 18:19:00 -0000	[thread overview]
Message-ID: <fd695806340147cbba3d42c761bfc063@ntmaexbe04.bedford.progress.com> (raw)
In-Reply-To: <384029be-4060-cb6b-d1e5-ea88cccb5999@Shaw.ca>

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


> On 2016-10-13 08:35, Bill Smith wrote:
> > I'm trying to run my Windows C++ application which has a call to
> > DebugBreak() to bring up the popup asking if you want to debug this
> > application or terminate it. If I run the program within Cygwin, the
> > program just exits.
> > If I run the application from a Windows command prompt, I get the
> > Windows popup that I'm expecting. It seems that the Cygwin shell is
> > eating exceptions (sigsegv or similar signals?). Is there a way for me
> > to disable this behavior?
> 
> Not giving us much info to go on here - is this a Cygwin, curses, Cygwin/X, or
> Windows native app, and what kind of popup is used?
> If a Windows native app, is it a console app, or do you run it with cygstart
> from Cygwin?
> If a Cygwin or X app, have you tried running strace, gdb (or a GUI FE) on it?
> If the latter, please post or attach the results, and attach the output from
> cygcheck -svr in a reply.
[Bill Smith] 
Sorry for the lack of info.  This is a Windows native console application.  Here's the source code:

#include <windows.h>

int main()
{
  DebugBreak();
}

Compiled it with Visual Studio 2010:

cl debug.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

debug.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:debug.exe
debug.obj

When you run the application from a Windows command prompt, you get a popup similar to:
http://imgur.com/a/VCgeW

It says "debug.exe has stopped working" and it gives you the option of closing the program, checking online for a solution, or to debug the program.

From a Cygwin shell, nothing happens.

Another example is to do an access violation (segv) with a program like this:


int main() {
 int* f = 0;

  *f = 1234; 
}

In Cygwin, It'll say "Segmentation Fault" and fail.  In Windows command prompt, I get the same popup with the other program which gives me the option to bring up the debugger.

Our product is built using the Visual Studio compiler and we do the build & test from within a Cygwin shell (c:\cygwin\bin\sh.exe).

I attached the cygcheck -svr output to this email.


Thanks,
--Bill




[-- Attachment #2: cygcheck_svr.txt.gz --]
[-- Type: application/x-gzip, Size: 19313 bytes --]

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

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

  reply	other threads:[~2016-10-13 17:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 15:24 Bill Smith
2016-10-13 16:57 ` Brian Inglis
2016-10-13 18:19   ` Bill Smith [this message]
2016-10-13 19:00     ` cyg Simple
2016-10-13 20:29       ` Bill Smith
2016-10-13 22:52         ` Larry Hall (Cygwin)
2016-10-14 12:34           ` Herbert Stocker
2016-10-13 22:55     ` Brian Inglis
2016-10-14 17:46       ` Bill Smith
2016-10-18 18:22         ` Wilfried
2016-10-18 19:46           ` cyg Simple
2016-10-13 22:55 ` Peter Rosin
2016-10-14 10:52   ` Peter Rosin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd695806340147cbba3d42c761bfc063@ntmaexbe04.bedford.progress.com \
    --to=bsmith@progress.com \
    --cc=Brian.Inglis@Shaw.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).