[issue2012] C++ programs crash in libc __cxa_finalize

Francois Tigeot (via DragonFly issue tracker) sinknull at leaf.dragonflybsd.org
Sat Mar 5 21:38:21 PST 2011


New submission from Francois Tigeot <ftigeot at wolfpond.org>:

Some C++ programs with a long list of registered destructors in .so crash on
DragonFly 2.8 and 2.9 systems.

The crashes seem to occur in __cxa_finalize from /usr/src/lib/libc/stdlib/atexit.c

Program received signal SIGSEGV, Segmentation fault.
0x0000000801535510 in ?? ()
(gdb) bt
#0  0x0000000801535510 in ?? ()
#1  0x00000008010b7db9 in __cxa_finalize (dso=0x0) at
/usr/src/lib/libc/../libc/stdlib/atexit.c:178
#2  0x00000008010b7a4a in exit (status=0) at
/usr/src/lib/libc/../libc/stdlib/exit.c:64
#3  0x000000000040223a in _start (ap=0x7fffffffcd60, cleanup=0x80050ef0d
<rtld_exit>) at /usr/src/lib/csu/x86_64/crt1.c:101
(gdb) quit

Our version of atexit.c was taken from FreeBSD in April 2010.
Just a bit later, the FreeBSD guys fixed a similar issue with C++ dynamic shared
objects.

We should pick-up the changes they made in revisions 1.11 and 1.12 of their
atexit.c :
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/atexit.c?f=u&only_with_tag=MAIN&logsort=date

----------
keyword: libc
messages: 9672
nosy: ftigeot
priority: bug
status: unread
title: C++ programs crash in libc  __cxa_finalize

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue2012>
_____________________________________________________






More information about the Bugs mailing list