public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] eh_personality.cc: unwinding on ARM
@ 2012-03-16 13:29 EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)
  2012-03-19 16:13 ` Andrew Stubbs
  0 siblings, 1 reply; 8+ messages in thread
From: EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31) @ 2012-03-16 13:29 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, paul, pwaechtler

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;



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-29 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-16 13:29 [PATCH] eh_personality.cc: unwinding on ARM EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)
2012-03-19 16:13 ` Andrew Stubbs
2012-03-19 16:38   ` Daniel Jacobowitz
2012-03-19 17:10     ` AW: " EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)
2012-03-19 17:33       ` Paul Brook
2012-03-19 20:43         ` Peter Waechtler
2012-03-29 18:10     ` Peter Waechtler
2012-03-23 16:52   ` AW: " EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).