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]

Re: how to avoid error dialog during app crash when non-interactive


Hans Horn wrote:

> I have an app build with gcc -mno-cygwin, that constantly bombards me with
> error dialogs as shown in the attachment.
> The app is meant to run non-interactively.
> Is there a way to compile the app differently so error notifications get
> simply printed out rather than being presented via dialog?

First of all, you're using the mingw compiler when you use -mno-cygwin,
so you should ask on the mingw list.  This has little to do with Cygwin.

But I don't think there's a lot you can do about this other than
obviously fixing your bugs that are causing the faults.  When you use
mingw you are using the Microsoft C runtime library (MSVCRT) and it sets
up its the fault hander which is what is showing the above dialog.  So I
don't think you have any control in that aspect.

I suppose you could try installing your own handler in the SEH chain
that would catch the access violation and handle it in some way.  If you
were using MSVC you could just use _try/_except but unfortunately gcc
does not support this, so you would have to do it manually.  (Is there a
set of macros out there somewhere that eases this?)  You'll have to
consult MSDN or google for more details there, not exactly on topic for
this list since Cygwin does exception handling in the posix way.  A
starting point is
<http://www.microsoft.com/msj/0197/Exception/Exception.aspx>.

Brian

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