This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with _Unwind_Backtrace() vs signal handlers
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: mckinlay at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 1 Aug 2004 15:12:35 +0200 (CEST)
- Subject: 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