Home | Tutorials | Wiki | Issues
Ask Your Question
0

Gazebo aborts with boost::lock_error when removing a model with physics::World::RemoveModel

asked 2014-07-26 19:14:09 -0500

Jim Jing gravatar image

updated 2014-07-26 19:16:40 -0500

Hi

I am using the gazebo simulator version 3.1 without ROS and trying to develop my own worldplugin and modelplugin. After I tried to remove an existing model from the world using the physics::World::RemoveModel method, i got an error

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument

Here are the traceback from gdb

#0  0x00007ffff4b6bf79 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff4b6f388 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff51716b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff516f836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff516f863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff516faa2 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff752d753 in boost::throw_exception<boost::lock_error> (e=...) at /usr/include/boost/throw_exception.hpp:67
#7  0x00007ffff7523a36 in boost::mutex::lock (this=0x7fff70c78920) at /usr/include/boost/thread/pthread/mutex.hpp:116
#8  0x00007ffff752dc3a in boost::unique_lock<boost::mutex>::lock (this=0x7fffde00b570) at /usr/include/boost/thread/lock_types.hpp:346
#9  0x00007ffff752dac1 in boost::unique_lock<boost::mutex>::unique_lock (this=0x7fffde00b570, m_=...)
    at /usr/include/boost/thread/lock_types.hpp:124
#10 0x00007ffff756b819 in gazebo::transport::Publisher::OnPublishComplete (this=0x7fff70c788e0, _id=1)
    at /home/asl/SMORES/gazebo_source/gazebo/gazebo/transport/Publisher.cc:227
#11 0x00007ffff756ed8b in boost::_mfi::mf1<void, gazebo::transport::Publisher, unsigned int>::operator() (this=0x7fffd80045d8, p=0x7fff70c788e0, 
    a1=1) at /usr/include/boost/bind/mem_fn_template.hpp:165
#12 0x00007ffff756eaf5 in boost::_bi::list2<boost::_bi::value<gazebo::transport::Publisher*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, gazebo::transport::Publisher, unsigned int>, boost::_bi::list1<unsigned int&> > (this=0x7fffd80045e8, f=..., a=...)
    at /usr/include/boost/bind/bind.hpp:313
#13 0x00007ffff756e81c in boost::_bi::bind_t<void, boost::_mfi::mf1<void, gazebo::transport::Publisher, unsigned int>, boost::_bi::list2<boost::_bi::value<gazebo::transport::Publisher*>, boost::arg<1> > >::operator()<unsigned int> (this=0x7fffd80045d8, a1=@0x7fffde00b664: 1)
    at /usr/include/boost/bind/bind_template.hpp:32
#14 0x00007ffff756e195 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, gazebo::transport::Publisher, unsigned int>, boost::_bi::list2<boost::_bi::value<gazebo::transport::Publisher*>, boost::arg<1> > >, void, unsigned int>::invoke (
    function_obj_ptr=..., a0=1) at /usr/include/boost/function/function_template.hpp:153
#15 0x00007ffff753148a in boost::function1<void, unsigned int>::operator() (this=0x7fffd80045d0, a0=1)
    at /usr/include/boost/function/function_template.hpp:767
#16 0x00007ffff751f255 in gazebo::transport::Connection::OnWrite (this=0x7fffd80034b0, _e=...)
    at /home/asl/SMORES/gazebo_source/gazebo/gazebo/transport/Connection.cc:383
#17 0x00007ffff7540e49 in boost::_mfi::mf1<void, gazebo::transport::Connection, boost::system::error_code const&>::call<boost::shared_ptr<gazebo::transport::Connection>, boost::system::error_code const> (this=0x7fffde00b9b8, u=..., b1=...) at /usr/include/boost/bind/mem_fn_template.hpp:156
#18 0x00007ffff753f4e0 in boost::_mfi::mf1<void, gazebo::transport::Connection, boost::system::error_code const&>::operator()<boost::shared_ptr<gazebo::transport::Connection> > (this=0x7fffde00b9b8, u=..., a1=...) at /usr/include/boost/bind/mem_fn_template.hpp:171
#19 0x00007ffff753d441 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-07-31 11:30:29 -0500

nkoenig gravatar image

I think this pull request may fix your problem.

We will release Gazebo 4.0 very shortly with the patch in place.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-07-26 19:14:09 -0500

Seen: 2,603 times

Last updated: Jul 31 '14