Mail Archives: djgpp/2002/06/06/01:31:39
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.
- Raw text -