Cannot delete models when using the transport system
Hello.
I am attempting to use the transport message system to have one plugin request another plugin to delete several models, using the world.RemoveModel() method, or model.Fini() method. When this simple system deletes any models, gazebo crashes, and I get the following error message:
gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:648: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::msgs::Response; typename boost::detail::sp_member_access<T>::type = gazebo::msgs::Response*]: Assertion `px != 0' failed.
I have confirmed that I can use these methods successfully, without issue. The only through-line I can identify with replicating this issue, is that the error appears when a deleting method is called from within a callback for a topic subscription.
I have tested (to the best of my ability) to confirm that the issue is not:
- That the shared pointer to the world is broken.
- That accessing the world at all is broken.
- That I cannot change things using any world methods.
- That the issue is specific to the world.RemoveModel() method.
- That deleting something from within a callback is broken, for example an event callback.
Which leads me to conclude it is specifically the transport system callbacks, and specifically deleting models.
Any ideas as to what causes this? For now, I'm just working around the issue.