Problems with _Unwind_Backtrace() vs signal handlers

Ulrich Weigand weigand@i1.informatik.uni-erlangen.de
Sun Aug 1 13:12:00 GMT 2004


Bryce McKinlay wrote:

>For a normal call, the IP returned by _Unwind_GetIP() is the return
>address for the frame above it - that is, the instruction following
>the "call" instruction. When unwinding through a signal handler,
>however, _Unwind_GetIP() returns a pointer to the faulting instruction.

Only for some signals (typically SIGSEGV and SIGBUS), not for others
(all asynchronous signals as well as SIGFPE and maybe SIGTRAP).

>Note that the unwinder seems to work fine through the signal frame
>to find an exception handler, it is just _Unwind_Backtrace() that fails.

This is most likely due to special hacks being performed in libjava
inside the signal handlers (MAKE_THROW_FRAME etc.) instead of having
the problem fixed generically ...

B.t.w. I've recently solved this very problem on s390(x):
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00625.html
(Requires a kernel patch for the full solution.)

Bye,
Ulrich 

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gcc mailing list