Avoid crash when stopping synthese
http://git.rcsmobility.com/openit/maintenance/issues/74
Stack:
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007fffe93c7801 in __GI_abort () at abort.c:79 #2 0x00007fffe9410897 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffe953db9a "%s\n") at ../sysdeps/posix/libc_fatal.c:181 #3 0x00007fffe941790a in malloc_printerr (str=str@entry=0x7fffe953f870 "double free or corruption (out)") at malloc.c:5350 #4 0x00007fffe941ee75 in _int_free (have_lock=0, p=0x55555628eb10, av=0x7fffe9772c40 <main_arena>) at malloc.c:4278 #5 __GI___libc_free (mem=0x55555628eb20) at malloc.c:3124 #6 0x00007fffedfbf871 in __gnu_cxx::new_allocator<std::_Rb_tree_node<synthese::tree::TreeFolderDownNodeInterface*> >::deallocate (this=<optimized out>, __p=<optimized out>) at /usr/include/c++/7/ext/new_allocator.h:125 #7 std::allocator_traits<std::allocator<std::_Rb_tree_node<synthese::tree::TreeFolderDownNodeInterface*> > >::deallocate (__a=..., __n=1, __p=<optimized out>) at /usr/include/c++/7/bits/alloc_traits.h:462 #8 std::_Rb_tree<synthese::tree::TreeFolderDownNodeInterface*, synthese::tree::TreeFolderDownNodeInterface*, std::_Identity<synthese::tree::TreeFolderDownNodeInterface*>, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::_M_put_node (this=0x555555e23c88, __p=<optimized out>) at /usr/include/c++/7/bits/stl_tree.h:592 #9 std::_Rb_tree<synthese::tree::TreeFolderDownNodeInterface*, synthese::tree::TreeFolderDownNodeInterface*, std::_Identity<synthese::tree::TreeFolderDownNodeInterface*>, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::_M_drop_node (this=0x555555e23c88, __p=<optimized out>) at /usr/include/c++/7/bits/stl_tree.h:659 #10 std::_Rb_tree<synthese::tree::TreeFolderDownNodeInterface*, synthese::tree::TreeFolderDownNodeInterface*, std::_Identity<synthese::tree::TreeFolderDownNodeInterface*>, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::_M_erase_aux (__position=..., this=0x555555e23c88) at /usr/include/c++/7/bits/stl_tree.h:2477 #11 std::_Rb_tree<synthese::tree::TreeFolderDownNodeInterface*, synthese::tree::TreeFolderDownNodeInterface*, std::_Identity<synthese::tree::TreeFolderDownNodeInterface*>, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::_M_erase_aux (__last=0x3, __first=0x1400000013, this=0x555555e23c88) at /usr/include/c++/7/bits/stl_tree.h:2491 #12 std::_Rb_tree<synthese::tree::TreeFolderDownNodeInterface*, synthese::tree::TreeFolderDownNodeInterface*, std::_Identity<synthese::tree::TreeFolderDownNodeInterface*>, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::erase (__x=<optimized out>, this=0x555555e23c88) at /usr/include/c++/7/bits/stl_tree.h:2502 #13 std::set<synthese::tree::TreeFolderDownNodeInterface*, std::less<synthese::tree::TreeFolderDownNodeInterface*>, std::allocator<synthese::tree::TreeFolderDownNodeInterface*> >::erase ( __x=<optimized out>, this=0x555555e23c88) at /usr/include/c++/7/bits/stl_set.h:675 #14 synthese::tree::TreeFolderUpNode::removeChild (value=..., this=0x555555e23c58) at /home/fli/openit/synthese/server/src/20_tree/TreeFolderUpNode.hpp:75 #15 synthese::tree::TreeFolderDownNodeInterface::removeParentLink (this=this@entry=0x55555628f300) at /home/fli/openit/synthese/server/src/20_tree/TreeFolderDownNodeInterface.cpp:103 #16 0x00007fffedfbf899 in synthese::tree::TreeFolderDownNodeInterface::setNullParent (this=this@entry=0x55555628f300) at /home/fli/openit/synthese/server/src/20_tree/TreeFolderDownNodeInterface.cpp:76 #17 0x00007fffedfb81ef in synthese::tree::TreeFolder::unlink (this=this@entry=0x55555628f2a0) at /home/fli/openit/synthese/server/src/20_tree/TreeFolder.cpp:71 #18 0x00007fffedfb84ed in synthese::tree::TreeFolder::~TreeFolder (this=this@entry=0x55555628f2a0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /home/fli/openit/synthese/server/src/20_tree/TreeFolder.cpp:55 #19 0x00007fffedfb8649 in synthese::tree::TreeFolder::~TreeFolder (this=0x55555628f2a0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /home/fli/openit/synthese/server/src/20_tree/TreeFolder.cpp:56 #20 0x00007fffedfd1f6a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55555628f280) at /usr/include/c++/7/bits/shared_ptr_base.h:154 #21 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/shared_ptr_base.h:684 #22 std::__shared_ptr<synthese::tree::TreeFolder, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/shared_ptr_base.h:1123 #23 std::shared_ptr<synthese::tree::TreeFolder>::~shared_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/shared_ptr.h:93 #24 std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >::~pair (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/stl_pair.h:198 #25 __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::destroy<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > (this=<optimized out>, __p=<optimized out>) at /usr/include/c++/7/ext/new_allocator.h:140 #26 std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > > >::destroy<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > (__a=..., __p=<optimized out>) at /usr/include/c++/7/bits/alloc_traits.h:487 #27 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_destroy_node (this=0x555555eb1648, __p=0x55555628f1e0) at /usr/include/c++/7/bits/stl_tree.h:650 #28 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_drop_node (this=0x555555eb1648, __p=0x55555628f1e0) at /usr/include/c++/7/bits/stl_tree.h:658 #29 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_erase (this=this@entry=0x555555eb1648, __x=0x55555628f1e0) at /usr/include/c++/7/bits/stl_tree.h:1858 #30 0x00007fffedfd1ee5 in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_erase ( this=this@entry=0x555555eb1648, __x=0x55555628f050) at /usr/include/c++/7/bits/stl_tree.h:1856 #31 0x00007fffedfd1ee5 in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_erase ( this=this@entry=0x555555eb1648, __x=0x5555562a8140) at /usr/include/c++/7/bits/stl_tree.h:1856 #32 0x00007fffedfd1ee5 in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> > > >::_M_erase ( this=this@entry=0x555555eb1648, __x=0x5555562a7490) at /usr/include/c++/7/bits/stl_tree.h:1856 #33 0x00007fffedfd202e in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::shared_ptr<synthese::tree::TreeFolder> >, std::_Select1st<std::pair<unsigned long long const, std::s