[reSIProcate] Question about multiple instances of libresiprocate.a in a single process
Hi. I am using resiprocate version from April on Linux.
I build libresiprocate.a (static lib).
Then I create two lib1.so and lib2.so that link in this libresiprocate.a
(It is done this way since these .so are plug-ins)
These libs lib1.so and lib2.so are loaded into a single process.
When I stop the process, I get a core from static destruction of this
map from os/Log.cxx (this is a global object)
HashMap<int, std::set<pthread_t> > Log::_serviceToThreads;
My guess is that when the process is shut down, the destructor is called
twice? Does that sound right? Stack trace is given below..
Question:
What am I doing wrong here? Any idea how to prevent this from happening?
Do I need to create a libresiprocate.so so that it will only be loaded
once?
Any help is appreciated
Thanks
(gdb) where
#0 0xae817500 in std::_Rb_tree<unsigned long, unsigned long,
std::_Identity<unsigned long>, std::less<unsigned long>,
std::allocator<unsigned long> >::_M_erase(std::_Rb_tree_node<unsigned
long>*) (
this=0x80aa260, __x=0x161) at stl_tree.h:1233
#1 0xae816d5b in std::_Rb_tree<unsigned long, unsigned long,
std::_Identity<unsigned long>, std::less<unsigned long>,
std::allocator<unsigned long> >::clear() (this=0x80aa260) at
stl_tree.h:847
#2 0xae816cfe in ~_Rb_tree (this=0x80aa260) at stl_tree.h:748
#3 0xae815a67 in ~set (this=0x80aa260) at hash_map:183
#4 0xae815aa8 in ~pair (this=0x80aa25c) at hash_map:183
#5 0xae81a28b in _Destroy<std::pair<const int, std::set<pthread_t,
std::less<pthread_t>, std::allocator<pthread_t> > > >
(__pointer=0x80aa25c) at stl_construct.h:125
#6 0xae819acc in __gnu_cxx::hashtable<std::pair<int const,
std::set<unsigned long, std::less<unsigned long>,
std::allocator<unsigned long> > >, int, __gnu_cxx::hash<int>,
std::_Select1st<std::pair<int const, std::set<unsigned long,
std::less<unsigned long>, std::allocator<unsigned long> > > >,
std::equal_to<int>, std::allocator<std::set<unsigned long,
std::less<unsigned long>, std::allocator<unsigned long> > >
>::_M_delete_node(__gnu_cxx::_Hashtable_node<std::pair<int const,
std::set<unsigned long, std::less<unsigned long>,
std::allocator<unsigned long> > > >*) (this=0xaea72978, __n=0x80aa258)
at stl_hashtable.h:539
#7 0xae818296 in __gnu_cxx::hashtable<std::pair<int const,
std::set<unsigned long, std::less<unsigned long>,
std::allocator<unsigned long> > >, int, __gnu_cxx::hash<int>,
std::_Select1st<std::pair<int const, std::set<unsigned long,
std::less<unsigned long>, std::allocator<unsigned long> > > >,
std::equal_to<int>, std::allocator<std::set<unsigned long,
std::less<unsigned long>, std::allocator<unsigned long> > > >::clear()
(this=0xaea72978) at stl_hashtable.h:950
#8 0xae815fe2 in ~hashtable (this=0xaea72978) at stl_hashtable.h:323
#9 0xae815abb in ~hash_map (this=0xaea72978) at os/Log.cxx:43
#10 0xae8151f8 in __static_initialization_and_destruction_0
(__initialize_p=0, __priority=65535)
at os/Log.cxx:43
#11 0xae8152b8 in _GLOBAL__D__ZN5resip3Log6_levelE () at
stl_hashtable.h:255
#12 0xae7e9cfb in __do_global_dtors_aux ()
--
Sandeep Sharma <ssharma@xxxxxxxxxx>