-
Notifications
You must be signed in to change notification settings - Fork 117
#592 fixed by manually resetting the kinematics loader #702
#592 fixed by manually resetting the kinematics loader #702
Conversation
model_.reset(); | ||
rdf_loader_.reset(); | ||
kinematics_loader_.reset(); | ||
|
||
ROS_DEBUG( "Robot model loader destructor" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think all these debug statements are needed, can you namespace them - ROS_DEBUG_NAMED("robot_model_loader", ...) so that I can hide them as needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know if they are needed, I used them to find the bug so I thought they might be of use to someone in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll clean this PR to be more simple and focused on the fix.
I'll try to explain why it works but it seems to be a complex issue on memory management and boost shared pointers and all that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think some user feedback and debug messages are useful, and they are easy to turn off using the rosconsole yaml configuration files. This is an underutilized feature of ROS, so I wrote up a blog post a while back about it: http://dav.ee/blog/notes/archives/898
However in this PR I think there are way too many. @v4hn is right that probably none of them are needed.
… PR moveit#702" This reverts commit 71ff802.
Looks good, except can you rebase your commits to just one please? |
I am investigating this issue at the moment and it seems to be either a bug in pluginlib or in our usage of it (or both). |
2da142f
to
eec9de6
Compare
@davetcoleman here is the rebase. |
eec9de6
to
383a895
Compare
@v4hn @alainsanguinetti I'm not really sure, how the proposed fix here, actually can solve the issue: Resetting the pointer is exactly what the default destructor would do as well, isn't it? |
@rhaschke I think the behaviour you mention is what class_loader is supposed to do. |
Indeed, ClassLoader shouldn't unload the library as long as it's still in use. Using MoveIt's rviz plugin, I actually get an appropriate warning message when unloading the plugin. |
As far as my investigation goes, resetting the shared_ptr explicitly changes the order of destruction. |
@alainsanguinetti could you please test #705 to see if this also resolves the problem? After debugging it for some more time and reading through @rhaschke's analysis, this is my understanding of the issue: |
Leaving aside #705 that I believe to be reasonable either way, I can see only one way out of this problem that does not imply rewriting class_loader (anyone is welcome to do this for upcoming ROS releases, I suppose). |
As mentioned also by @v4hn, #705 will not fix the issue. The only workaround, I can see for now, is to disable destruction of |
PR #705 is a better fix than this one so I close this one to avoid confusion. |
Issue #592 was very annoying and prevented properly exiting from a running program.
I think this solves the issue, it does for my quite complex software and for the very simple example provided by @fontysrobotics.
Valgrind seem to have some complaints but:
Please let me know if I need to provide additionnal information.