Date: Thu, 6 Jun 2002 08:28:21 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Alex Oleynikov cc: djgpp AT delorie DOT com Subject: Re: Exception handling In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 6 Jun 2002, Alex Oleynikov wrote: > 1.First of all, I am using 'REDIR -e crash.dmp myprog.exe' to capture the > stderr output from my application. In 99% of crash situations the resulting > crash.dmp file is empty, although if I run the program directly I can see > the stack traceback output on the screen. Also, if I redirect it to a > printer it prints the whole thing fine. Why doesn't REDIR save this > information to my file? It does for me. I think this is something specific to your system or your crashes. What OS is that? Can you post a short program that crashes, for which `redir' doesn't produce a traceback in a file? Btw, if it's NT or Windows 2000, there's an incompatible program called redir.exe, so perhaps you inadvertently use that instead of the DJGPP version of `redir'. > 2.I hooked my handlers to several signals (SIGINT, SIGABRT, SIGSEGV and > SIGFPE). The handler basically saves a timestamp and the signal description > to a file, displays a message on the screen and calls > __djgpp_traceback_exit( ) procedure. For some reason, when SIGABRT signal is > being processed, the computer locks up completely when calling > __djgpp_traceback_exit(). I also tried using exit() or simply return from > the signal handler (since the SIGABRT is raised from assert()) - the result > is always the same - the computer locks up. Why is that? SIGABRT is not a real exception, so it's treated a bit differently. However, it shouldn't lock up. Please show the code of your signal handler, and how you install it, there's probably something wrong with that. > 2.If I will not be able to solve the problem with REDIR, is there a way to > get an output similar to the one produced by __djgpp_traceback_exit(), but > without terminating the application? In other words, can I somehow save the > stack traceback to a log file from within my signal handler? The sources of the library are freely available: download djlsr203.zip and look at the file src/libc/go32/dpmiexcp.c, where you will find the code that prints the traceback.