Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gazebo 8 crashes if a model containing a gazebo_yarp_controlboard plugin is removed #282

Closed
traversaro opened this issue Feb 27, 2017 · 5 comments

Comments

@traversaro
Copy link
Member

traversaro commented Feb 27, 2017

Gazebo crashes with no further information.
Currently verified in Gazebo 8 on macOS Sierra by me and @nunoguedelha .
Model removal seems to work fine on Gazebo 7 on Ubuntu 16.04 .
We still need to test on Gazebo 8 on Ubuntu 16.04 .

@traversaro
Copy link
Member Author

Sometimes, on crash Gazeb outputs the following error:

gzserver(11133,0x700002e0d000) malloc: *** error for object 0x7febd0a73560: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

@traversaro
Copy link
Member Author

After half an hour of simulation:

[INFO]created device <gazebo_controlboard>. See C++ class GazeboYarpControlBoardDriver for documentation.
gzserver(11159,0x70000d6e5000) malloc: *** error for object 0x7f9d74d699f0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
gzclient(11160,0x7fffa82af3c0) malloc: *** error for object 0x7f9dbcf64080: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

@traversaro
Copy link
Member Author

@traversaro
Copy link
Member Author

More in detail, it seems that in Gazebo 8 the Disconnect methods are deprecated:

Deprecation: public: void Event::Disconnect(ConnectionPtr);
Deprecation: public: void EventT::Disconnect(ConnectionPtr);
Replacement: Delete the Connection object, perhaps by calling reset() on its smart pointer.

An easy fix for this can be to just called the reset() method on the connection after the call to the Disconnect method (this will continue to work for all Gazebo versions). The fact that the method is deprecated and not removed means that it should still work, and the fact that is not working I think is a Gazebo 8 bug. However I will not take the time to properly open a Gazebo bug because it is a transient behavior that only affect Gazebo 8 .

@traversaro traversaro changed the title Gazebo 8 on macOS Sierra crashes if a model containing a gazebo_yarp_controlboard plugin is removed Gazebo 8 crashes if a model containing a gazebo_yarp_controlboard plugin is removed Feb 28, 2017
traversaro added a commit to traversaro/gazebo_yarp_plugins that referenced this issue Feb 28, 2017
Streamlining of the disconnection event: simply resetting the
Connection shared pointer is enough to disconnect an event
since at least Gazebo 2. So the code was cleaned up from all
the call to the Disconnect* functions are all the unnecessary
check if a connection pointer is valid before resetting it.

Fix robotology#282 .
traversaro added a commit to traversaro/gazebo_yarp_plugins that referenced this issue Feb 28, 2017
Streamlining of the disconnection event: simply resetting the
Connection shared pointer is enough to disconnect an event
since at least Gazebo 2. So the code was cleaned up from all
the call to the Disconnect* functions are all the unnecessary
check if a connection pointer is valid before resetting it.

Fix robotology#282 .
@traversaro
Copy link
Member Author

Migrating away from the Disconnect function in #285 actually solved this issue. While I can't investigate further the problem with the Disconnect* functions in Gazebo 8 (that should be just deprecated, and hence continue to work) perhaps it is worth to at least notify this strange behavior to @scpeters .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants