public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/60758] New: Infinite backtrace in  __cxa_end_cleanup
@ 2014-04-04  7:51 alexey.merzlyakov at samsung dot com
  2014-04-04  7:51 ` [Bug libstdc++/60758] " alexey.merzlyakov at samsung dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: alexey.merzlyakov at samsung dot com @ 2014-04-04  7:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60758

            Bug ID: 60758
           Summary: Infinite backtrace in  __cxa_end_cleanup
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexey.merzlyakov at samsung dot com
                CC: v.garbuzov at samsung dot com, y.gribov at samsung dot com
            Target: arm

Created attachment 32542
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32542&action=edit
Testcase to reproduce

While debugging a compiled testcase, the infinite backtrace appears:
  Breakpoint 1, __gnu_end_cleanup () at
../../../../gcc-src/libstdc++-v3/libsupc++/eh_arm.cc:134
  134    ../../../../gcc-src/libstdc++-v3/libsupc++/eh_arm.cc: No such file or
directory.
  (gdb) bt
  #0  __gnu_end_cleanup () at
../../../../gcc-src/libstdc++-v3/libsupc++/eh_arm.cc:134
  #1  0xb6f45b2c in __cxa_end_cleanup () from /lib/libstdc++.so.6
  #2  0xb6f45b2c in __cxa_end_cleanup () from /lib/libstdc++.so.6
  #3  0xb6f45b2c in __cxa_end_cleanup () from /lib/libstdc++.so.6
  #4  0xb6f45b2c in __cxa_end_cleanup () from /lib/libstdc++.so.6
  ...

GCC configuration:
  $ arm-linux-gnueabi-gcc -v
  Using built-in specs.
  COLLECT_GCC=./arm-linux-gnueabi-gcc
 
COLLECT_LTO_WRAPPER=/home/alexey.merzlyakov/arm/libexec/gcc/arm-linux-gnueabi/4.9.0/lto-wrapper
  Target: arm-linux-gnueabi
  Configured with: ../gcc-src/configure --host=i686-pc-linux-gnu
--target=arm-linux-gnueabi --prefix=/home/alexey.merzlyakov/arm
--with-sysroot=/home/alexey.merzlyakov/arm/arm-linux-gnueabi/sys-root
--disable-libmudflap --disable-libssp --with-mode=arm --with-fpu=vfpv3
--with-cpu=cortex-a15 --with-tune=cortex-a15 --with-float=softfp
--disable-libatomic --disable-libgomp --enable-languages=c,c++
--with-gmp=/home/alexey.merzlyakov/arm --with-mpfr=/home/alexey.merzlyakov/arm
--with-mpc=/home/alexey.merzlyakov/arm
  Thread model: posix
  gcc version 4.9.0 20140403 (experimental) (GCC)

Compiling the testcase:
  $ arm-linux-gnueabi-g++ rethrow_if_nested.ii -std=gnu++0x -g

The __cxa_end_cleanup() does not save/restore LR in function header/footer and
does not provide any unwind info:
libstdc++-v3/libsupc++/eh_arm.cc ->
  "__cxa_end_cleanup:\n"
  "       push\t{r1, r2, r3, r4}\n"
  "       bl\t__gnu_end_cleanup\n"
  "       pop\t{r1, r2, r3, r4}\n"
  "       bl\t_Unwind_Resume @ Never returns\n"
GDB uses LR saving/restoring information when making a backtrace (when unwind
info is not available). Otherwise if there are no information, the LR on
current frame will be equal to LR on previous frame. It causes GDB to generate
same backtrace-items for __cxa_end_cleanup again and again.

I would expect the same problem for other tools that unwind stacks (e.g. unwind
code in libgcc, libbacktrace, etc.).

So, it seems to be a libstdc++ bug. Adding the LR in the arguments of
save/restore instructions in __cxa_end_cleanup() code fixes it. Another option
would be to add unwind entries (.cfi_whatever).


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

end of thread, other threads:[~2015-04-22 19:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04  7:51 [Bug libstdc++/60758] New: Infinite backtrace in __cxa_end_cleanup alexey.merzlyakov at samsung dot com
2014-04-04  7:51 ` [Bug libstdc++/60758] " alexey.merzlyakov at samsung dot com
2014-04-04 16:03 ` ramana at gcc dot gnu.org
2014-04-07  6:20 ` alexey.merzlyakov at samsung dot com
2014-05-16 13:17 ` merzlyakovao at gcc dot gnu.org
2014-05-19 11:19 ` alexey.merzlyakov at samsung dot com
2014-05-19 11:26 ` alexey.merzlyakov at samsung dot com
2014-05-20  6:27 ` alexey.merzlyakov at samsung dot com
2014-05-20 17:26 ` ygribov at gcc dot gnu.org
2015-04-22 19:53 ` ramana at gcc dot gnu.org

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).