Problems with _Unwind_Backtrace() vs signal handlers
Bryce McKinlay
mckinlay@redhat.com
Mon Aug 2 17:59:00 GMT 2004
Andrew Haley wrote:
>I see that the signal handlers in libgcj create the exception before
>calling MAKE_THROW_FRAME: that's a bug. In the past this wasn't a bug
>because we didn't use the unwinder to generate the stack trace.
>
>We shouldn't see an incorrect return address unless we're calling
>_Unwind_Backtrace before MAKE_THROW_FRAME, and there's no reason to do
>that.
>
>I suggest you try something like
>
>SIGNAL_HANDLER (catch_segv)
>{
> unblock_signal (SIGSEGV);
> MAKE_THROW_FRAME (nullp);
> java::lang::NullPointerException *nullp
> = new java::lang::NullPointerException;
> throw nullp;
>}
>
>
This was indeed the problem - thanks Andrew!
Regards
Bryce
More information about the Gcc
mailing list