This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with _Unwind_Backtrace() vs signal handlers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]