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


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


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