Segmentation fault when using -D_GLIBCXX_DEBUG flag with model plugins on latest (7.4.0) release

Issue #2076 new
Anonymous created an issue

To reproduce: On 7.4.0 using Ubuntu 16.04LTS, when using the -D_GLIBCXX_DEBUG compiler flag with the model plugin example on the Gazebo website, there is a seg fault. Backtrace from GDB below.

#0  0x00007fff909e8854 in std::less<int>::operator()(int const&, int const&) const () from /home/evan/Downloads/libmodel_push.so
#1  0x00007fff909eaf02 in std::_Rb_tree<int, std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > >, std::_Select1st<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > > >::_M_lower_bound(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > >*, std::_Rb_tree_node<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > >*, int const&) () from /home/evan/Downloads/libmodel_push.so
#2  0x00007fff909ea573 in std::_Rb_tree<int, std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > >, std::_Select1st<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > > >::lower_bound(int const&) () from /home/evan/Downloads/libmodel_push.so
#3  0x00007fff909e996d in std::__cxx1998::map<int, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > > >::lower_bound(int const&) () from /home/evan/Downloads/libmodel_push.so
#4  0x00007fff909e8a79 in std::__cxx1998::map<int, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<gazebo::event::EventConnection<void (gazebo::common::UpdateInfo const&)> > > > >::operator[](int const&) () from /home/evan/Downloads/libmodel_push.so
#5  0x00007fff909e7c5e in gazebo::event::EventT<void (gazebo::common::UpdateInfo const&)>::Connect(boost::function<void (gazebo::common::UpdateInfo const&)> const&) () from /home/evan/Downloads/libmodel_push.so
#6  0x00007fff909e6917 in boost::shared_ptr<gazebo::event::Connection> gazebo::event::Events::ConnectWorldUpdateBegin<boost::_bi::bind_t<void, boost::_mfi::mf1<void, gazebo::ModelPush, gazebo::common::UpdateInfo const&>, boost::_bi::list2<boost::_bi::value<gazebo::ModelPush*>, boost::arg<1> > > >(boost::_bi::bind_t<void, boost::_mfi::mf1<void, gazebo::ModelPush, gazebo::common::UpdateInfo const&>, boost::_bi::list2<boost::_bi::value<gazebo::ModelPush*>, boost::arg<1> > >) () from /home/evan/Downloads/libmodel_push.so
#7  0x00007fff909e564b in gazebo::ModelPush::Load(boost::shared_ptr<gazebo::physics::Model>, std::shared_ptr<sdf::Element>) ()
   from /home/evan/Downloads/libmodel_push.so
#8  0x00007ffff624aefc in gazebo::physics::Model::LoadPlugin(std::shared_ptr<sdf::Element>) ()
   from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.7
#9  0x00007ffff624de30 in gazebo::physics::Model::LoadPlugins() () from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.7
#10 0x00007ffff6292b05 in gazebo::physics::World::LoadPlugins() () from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.7
#11 0x00007ffff62a4fd5 in gazebo::physics::World::Step() () from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.7
#12 0x00007ffff62a5365 in gazebo::physics::World::RunLoop() () from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.7
#13 0x00007ffff40525d5 in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0
#14 0x00007ffff65c46fa in start_thread (arg=0x7fff91bf8700) at pthread_create.c:333
#15 0x00007ffff6bcdb5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109