Mail Archives: djgpp/1998/09/24/09:27:56
Date: | Thu, 24 Sep 1998 15:26:14 +0200 (CEST)
|
Message-Id: | <199809241326.PAA10226@login-2.eunet.no>
|
From: | "Gisle Vanem" <giva AT bgnett DOT no>
|
To: | djgpp AT delorie DOT com
|
Subject: | preserving exception context
|
MIME-Version: | 1.0
|
I have a rather large program that must exit gracefully even after
crashing. I've installed a signal-handler for SIGSEGV/SIGFPE which
is supposed to exit safely. In the exception handler I have:
signal (SIGSEGV,SIG_DFL); /* to prevent nested SIGSEGV's */
shutdown(); /* lot of tidying up here */
raise (SIGABRT); /* traceback, exit */
The problem is that if shutdown() also crashes, I get a traceback for
that crash and not the originating fault. How can I (besides writing
shutdown() foulproof) get a traceback for both or a least only the first
crash.
The crash in shutdown() is most certainly a consequence of the first crash
so that it's not so (IMHO) important to trace. (i.e. overwritten data etc.)
Note, this is all with djgpp 2.02 alpha, where `raise(SIGABRT)' seems to
work as intended (I sometimes got stange results in 2.01).
Otherwise I use DOS 6.22, QEMM 7.53 and CWSDPMI on a 90MHz Pentium PC.
Gisle V.
- Raw text -