Interpret object causing crash in __cxa_finalize (have core)

Jeffrey Walton
2011-08-24T19:31:33Z

Hi All,

I'm observing an intermittent crash during unloading of a shared
object. The library and test harness were built with '-g3 -ggdb -O0',
and 'ulimit -c unlimited', so I am able to get it under GDB. But I'm
having problems interpreting what object is being problematic.

$ gdb
...
(gdb) file <path to self test> # loads OK
(gdb) core core # loads OK
(gdb) bt full
...
#21 0x00002ba649808630 in __cxa_finalize (d=0x2ba64901c3d8)
at cxa_finalize.c:56
check = <value optimized out>
cxafn = 0x6
cxaarg = 0xa46
f = 0x13925e0
funcs = 0x13924f0
(gdb) po 0x13925e0
evaluation of this expression requires the target program to be active

Any ideas how to proceed?

Thanks in advance,
Jeff

(gdb) bt full
#0 0x00002ba649802a75 in *__GI_raise (sig=<value optimized out>)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
pid = <value optimized out>
selftid = <value optimized out>
#1 0x00002ba6498065c0 in *__GI_abort () at abort.c:92
act = {__sigaction_handler = {sa_handler = 0x7fffecc59ff0,
sa_sigaction = 0x7fffecc59ff0}, sa_mask = {__val = {
140737165762736, 140737165774648, 22, 47993198828606, 1,
4256528, 99, 47993198832910, 3, 140737165762734, 2,
47993198828632, 1, 47993198837551, 3, 140737165762746}},
sa_flags = 6, sa_restorer = 0x2ba649917f33}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00002ba64983c4fb in __libc_message (do_abort=<value optimized out>,
fmt=<value optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
ap = {{gp_offset = 40, fp_offset = 48,
overflow_arg_area = 0x7fffecc5aa30,
reg_save_area = 0x7fffecc5a940}}
ap_copy = {{gp_offset = 16, fp_offset = 48,
overflow_arg_area = 0x7fffecc5aa30,
reg_save_area = 0x7fffecc5a940}}
fd = 3
on_2 = <value optimized out>
list = <value optimized out>
nlist = 1024
cp = <value optimized out>
written = false
#3 0x00002ba6498465b6 in malloc_printerr (action=3,
str=0x2ba649919cd8 "double free or corruption (!prev)",
ptr=<value optimized out>) at malloc.c:6266
buf = "00000000013a21c0"
cp = 0x0
#4 0x00002ba64984ce83 in *__GI___libc_free (mem=<value optimized out>)
at malloc.c:3738
ar_ptr = 0x2ba649b4de40
p = 0x0
#5 0x0000000000470ac0 in
__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<char const,
std::string> > >::deallocate (this=0x83dfc0, __p=0x13a21c0)
at /usr/include/c++/4.4/ext/new_allocator.h:95
No locals.
#6 0x00000000004708ca in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_put_node (this=0x83dfc0,
__p=0x13a21c0) at /usr/include/c++/4.4/bits/stl_tree.h:363
No locals.
#7 0x0000000000470326 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_destroy_node (
this=0x83dfc0, __p=0x13a21c0) at /usr/include/c++/4.4/bits/stl_tree.h:409
No locals.
#8 0x000000000046fc65 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a21c0) at /usr/include/c++/4.4/bits/stl_tree.h:972
__y = 0x0
#9 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a2140) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a2100
#10 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a2100) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a20c0
#11 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a20c0) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a2080
#12 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a2080) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a2040
#13 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a2040) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a2000
#14 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a2000) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a1fc0
#15 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a1fc0) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a1f80
#16 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a1f80) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a1f40
#17 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a1f40) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x13a1f00
#18 0x000000000046fc42 in std::_Rb_tree<char, std::pair<char const,
std::string>, std::_Select1st<std::pair<char const, std::string> >,
std::less<char>, std::allocator<std::pair<char const, std::string> >
>::_M_erase (this=0x83dfc0,
__x=0x13a1f00) at /usr/include/c++/4.4/bits/stl_tree.h:970
__y = 0x83dfc0
#19 0x000000000046f7db in ~_Rb_tree (this=0x83dfc0,
__in_chrg=<value optimized out>)
at /usr/include/c++/4.4/bits/stl_tree.h:614
No locals.
#20 0x0000000000470c0a in ~map (this=0x83dfc0, __in_chrg=<value optimized out>)
at /usr/include/c++/4.4/bits/stl_map.h:87
No locals.
#21 0x00002ba649808630 in __cxa_finalize (d=0x2ba64901c3d8)
at cxa_finalize.c:56
check = <value optimized out>
cxafn = 0x6
cxaarg = 0xa46
f = 0x13925e0
funcs = 0x13924f0
#22 0x00002ba648c59076 in __do_global_dtors_aux () from lib/libesapi-c++.so
No symbol table info available.
#23 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb)