This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin shell eats Windows exceptions?
On 10/13/2016 1:56 PM, Bill Smith wrote:
> Sorry for the lack of info. This is a Windows native console application. Here's the source code:
>
> #include <windows.h>
>
A "console application" doesn't require windows.h but this isn't the issue.
> 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.
The Windows cmd console and the Cygwin console behave differently to the
exception. Not a bug, just not what you wanted.
What if you 'cmd.exe /c foo.exe' from the Cygwin shell? Will the
Dialogue popup box occur? If so you can provide a sh script foo to
execute the foo.exe file.
--
cyg Simple
--
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