This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH] eh_personality.cc: unwinding on ARM
- From: "EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)" <external dot Peter dot Waechtler at de dot bosch dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, "paul at codesourcery dot com" <paul at codesourcery dot com>, "pwaechtler at mac dot com" <pwaechtler at mac dot com>
- Date: Fri, 16 Mar 2012 14:29:17 +0100
- Subject: [PATCH] eh_personality.cc: unwinding on ARM
Sorry this is a resend with corrected email addresses,
I noticed a bug in the __ARM_EABI_UNWINDER__ case that shows up
as a loop in backtrace():
======= Backtrace: =========
/lib/libc.so.6[0x4c8c11cc]
/lib/libc.so.6[0x4c8c62a8]
/lib/libc.so.6(cfree+0x38)[0x4c8c63a8]
./bt(_Z6nqueenPiii+0xf0)[0xa8e0]
./bt(_Z6nqueenPiii+0xf0)[0xa8e0]
./bt(_Z6nqueenPiii+0xf0)[0xa8e0]
./bt(_Z6nqueenPiii+0xf0)[0xa8e0]
[.. and so on]
while a proper callstack (with demangled names and libunwind) looks like:
====== backtrace (libunwind):
./bt( libunwind_backtrace +0x30)[0xb4a4]
./bt( eh_stack_unwind +0xe0)[0xb3c0]
./bt[0xc704]
/lib/libc.so.6( __default_rt_sa_restorer_v2 +0x0)[0x4c883770]
/lib/libc.so.6( gsignal +0x40)[0x4c88241c]
/lib/libc.so.6( abort +0x1c0)[0x4c88680c]
/lib/libc.so.6[0x4c8b726c]
/lib/libc.so.6[0x4c8c11cc]
/lib/libc.so.6[0x4c8c62a8]
/lib/libc.so.6( cfree +0x38)[0x4c8c63a8]
./bt( nqueen(int*, int, int) +0xf0)[0xa8e0]
./bt( main +0x230)[0xac6c]
/lib/libc.so.6( __libc_start_main +0x120)[0x4c86d104]
./bt[0xa510]
The CodeSourcery toolchain contains a "fix" like the following,
please consider for adding it.
Best regards
Peter Wächtler
--- eh_personality.cc.orig 2012-02-28 16:35:20.000000000 +0100
+++ eh_personality.cc 2012-02-28 18:12:03.000000000 +0100
@@ -387,6 +386,9 @@
switch (state & _US_ACTION_MASK)
{
case _US_VIRTUAL_UNWIND_FRAME:
+ if (state & _US_FORCE_UNWIND)
+ CONTINUE_UNWINDING;
+
actions = _UA_SEARCH_PHASE;
break;