nodelet_core icon indicating copy to clipboard operation
nodelet_core copied to clipboard

Loader crash issue

Open ohryshchuk opened this issue 6 years ago • 2 comments

Hi,

There is a crash issue inside LoaderROS:

#0  0x00007fe209c44258 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*> > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#1  0x00007fe209c3bf65 in nodelet::Loader::unload(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#2  0x00007fe209c4715b in nodelet::LoaderROS::unload(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#3  0x00007fe2097f2141 in bond::Bond::flushPendingCallbacks() () from /opt/ros/kinetic/lib/libbondcpp.so
No symbol table info available.
#4  0x00007fe2097f2675 in bond::Bond::breakBond() () from /opt/ros/kinetic/lib/libbondcpp.so
No symbol table info available.
#5  0x00007fe2097f3fc5 in bond::Bond::~Bond() () from /opt/ros/kinetic/lib/libbondcpp.so
No symbol table info available.
#6  0x00007fe209c52971 in nodelet::LoaderROS::~LoaderROS() () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#7  0x00007fe209c52af2 in boost::detail::sp_counted_impl_p<nodelet::LoaderROS>::dispose() () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#8  0x00007fe209c3a6fa in ?? () from /opt/ros/kinetic/lib/libnodeletlib.so
No symbol table info available.
#9  0x00007fe209c3abd5 in nodelet::Loader::~Loader() () from /opt/ros/kinetic/lib/libnodeletlib.so

Please consider fix in attachment. It addresses two issues:

  1. Protection of bond_map_ deletion against concurrent access from multiple threads.
  2. nodelets_ must outlive LoaderROS. According to above stack trace Loader accesses nodelets_ when it is already deleted.

crash_fix.txt

ohryshchuk avatar Nov 04 '19 10:11 ohryshchuk

This crash was reproduced on Ubuntu 16.04.6 with latest ROS Kinetic Kame packages and nodelet 1.9.14

vshum avatar Nov 14 '19 16:11 vshum

@ohryshchuk please consider opening a PR for the fix

flixr avatar Jan 12 '20 23:01 flixr