This is the mail archive of the
mailing list for the Cygwin project.
Re: gcc4: throwing exception from signal handler
VÃclav Haismam wrote:
On Thu, 8 Jul 2010 09:01:41 -0400, "Don Ward" wrote:
I would like to be able to catch certain signals (SIGSEGV and SIGSYS)
I do not think that handling SIGSEGV with an exception is a good idea.
throw a C++ exception (to be caught in a try/catch construct). As a
Am I misunderstanding how this should work or doing something wrong? Or
this a problem with Cygwin or gcc?
I agree, in general.
Unless you get SIGSEGV as a result of some well thought through memory
But that is what I am doing. I also want to catch SIGSYS to determine
whether shmat() is available when we don't know in advance whether cygserver
is running. In either case, if the signal is generated I want to catch it
and try something else. In these contexts I want to treat SIGSEGV and
SIGSYS as non-fatal error returns.
. . .
I am not sure but I do not think that throwing exceptions from signal
handlers is generally supported.
It appears that is what the -fnon-call-exceptions is for. From the
"-fnon-call-exceptions: Generate code that allows trapping instructions to
throw exceptions. Note that this requires platform-specific runtime support
that does not exist everywhere."
I guess one question is whether the runtime support exists in Cygwin 1.7
with gcc 4.3.4.
-- Don W.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple