You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FCL collision checking crashes during motion #3083
In some situations (I haven't been able to find a common cause), the move group crashes when executing a motion. Backtracing with gdb suggests that the crash is occuring within the FCL collision checker.
ROS Distro
Humble
OS and version
Ubuntu 22.04 (via docker)
Source or binary build?
Both
(source for moveit_core and pilz_industrial_motion_planner, binaries for everything else)
If binary, which release version?
2.5.5
(for everything besides moveit_core and pilz_industrial_motion_planner)
Our robot performs a move on start-up. This motion sometimes crashes and sometimes succeeds.
The crash seems to be related to collision objects, so I wonder if the success case occurs when the robot moves before the object have loaded
I believe our xacro contains some typos in names when disabling collisions. I wonder if the collision checker is looking up an object that doesn't exist, and dereferencing a nullptr somewhere. I'll fix the typos tomorrow and test.
When we manually attempt to move the robot to a pose, the motion consistently crashes.
I don't have the logs to hand at the moment, but there was a message indicating the plan succeeded before the crash, so it may be execution that's crashing
Ah actually, our version of moveit builds moveit_core and pilz_industrial_motion_planner from source, with some fixes from recent PRs. The branch is https://github.com/rr-tom-noble/moveit2/tree/bugfix/pilz-fix, which is based on humble plus #3077, #3055, #3070. None of those PRs touch collision checking and I believe FCL runs after the motion has been planned, so I think this represents a new issue we're running into now that those PRs have fixed our usage of pilz and the plan is reaching the collision checking stage
@rr-mark, indeed collision_common.cpp:199 is wrong.
However, probably it's unrelated to the observed segfault, which occurs earlier, in collision_common.cpp:167.
The crash is also unrelated to execution: The log clearly shows that execution was successfully finished.
Only later, in MoveGroupStateValidationService, the crash occurs. Do you explicitly call this service?
It looks like cdata->res_->contacts is being used uninitialised. Printing cdata->res_->contacts.size() gives 97998116997072
(I'm assuming this is just random memory), and trying to iterate across cdata->res_->contacts throws
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Objects are automatically initialized by calling the default constructor. I think cdata->res_->contacts is corrupted (or released) after creation. You need to figure out why/when.
Hmm, adding moveit_ros.move_group to our list of source dependencies seems to have fixed the problem. Maybe this is a problem with our mix of source and binary dependencies, rather than a problem with moveit.
As @rr-mark mentioned, building the additional packages seems to have fixed the issue. I think the cause was that our binaries are from 2.5.5, whereas our build-from-source packages are based on the moveit2 humble branch, which contains backports, so we were likely linking between incompatible shared objects.
Activity
TSNoble commentedon Nov 11, 2024
Some additional findings:
riv-tnoble commentedon Nov 12, 2024
I just checked and the typos in collision disabling have been fixed, so that rules out that as a cause.
I'm fairly confident the issue in in these lines, since the backtrace suggests the crash occurs within
std::_Rb_tree::find(), which is the underlying type ofstd::set.active_components_only_uses astd::set.These are the logs leading up to the failure:
riv-tnoble commentedon Nov 12, 2024
Ah actually, our version of moveit builds
moveit_coreandpilz_industrial_motion_plannerfrom source, with some fixes from recent PRs. The branch is https://github.com/rr-tom-noble/moveit2/tree/bugfix/pilz-fix, which is based on humble plus #3077, #3055, #3070. None of those PRs touch collision checking and I believe FCL runs after the motion has been planned, so I think this represents a new issue we're running into now that those PRs have fixed our usage of pilz and the plan is reaching the collision checking stageriv-mjohnson commentedon Nov 12, 2024
Backtrace with line numbers:
riv-mjohnson commentedon Nov 12, 2024
Probably not related to the current problem, but line 199 of collision_common.cpp is suspicious:
Why is this storing the output of
std::make_pairby reference?rhaschke commentedon Nov 12, 2024
@rr-mark, indeed collision_common.cpp:199 is wrong.
However, probably it's unrelated to the observed segfault, which occurs earlier, in collision_common.cpp:167.
The crash is also unrelated to execution: The log clearly shows that execution was successfully finished.
Only later, in
MoveGroupStateValidationService, the crash occurs. Do you explicitly call this service?riv-mjohnson commentedon Nov 12, 2024
Yes, we call
/move_group/check_state_validityfor checking pre-planned trajectories are still valid.riv-mjohnson commentedon Nov 12, 2024
And yes, you're right, it is during that service call that it crashes.
riv-mjohnson commentedon Nov 12, 2024
I'm adding some debug prints now to try and work out what's going wrong.
riv-mjohnson commentedon Nov 12, 2024
It looks like
cdata->res_->contactsis being used uninitialised. Printingcdata->res_->contacts.size()gives97998116997072(I'm assuming this is just random memory), and trying to iterate across
cdata->res_->contactsthrowsriv-mjohnson commentedon Nov 12, 2024
Both
cdataandcdata->res_look like valid pointers.riv-mjohnson commentedon Nov 12, 2024
(Fixing line 199 did not fix the crash)
rhaschke commentedon Nov 12, 2024
Objects are automatically initialized by calling the default constructor. I think
cdata->res_->contactsis corrupted (or released) after creation. You need to figure out why/when.riv-mjohnson commentedon Nov 12, 2024
I'm confused.
CollisionResultis default initialised inMoveGroupStateValidationService::computeService.PlanningScene::checkCollision,res.contacts.size()is already junk.I'm just rejigging my dependency stack so I can get debugging and prints from moveit_ros.
riv-mjohnson commentedon Nov 12, 2024
Hmm, adding
moveit_ros.move_groupto our list of source dependencies seems to have fixed the problem. Maybe this is a problem with our mix of source and binary dependencies, rather than a problem with moveit.rhaschke commentedon Nov 12, 2024
Probably. The collision checking code is rather old and segfaults weren't reported for quite some time...
riv-tnoble commentedon Nov 12, 2024
As @rr-mark mentioned, building the additional packages seems to have fixed the issue. I think the cause was that our binaries are from
2.5.5, whereas our build-from-source packages are based on the moveit2 humble branch, which contains backports, so we were likely linking between incompatible shared objects.Closing this issue.