-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Costmap_2d crash if deactivate and cleanup too quick #2573
Comments
It looks to me that the timer created in the TF buffer didn't get a chance to fully shut down or something before it was destructed. So when its called, its crashing because the object doesn't exist. The can transform call you mention specifically confirms that I believe, since that timer is used in the can transform function almost exclusively. I think the fix would be to kill the timers that are active in the destructor of the buffer. All of the destructurs of the Buffer (e.g. buffer and the interfaces it derives from) use the default destructor. I think the This is an issue for TF2 though, can you file it there and delete this? I don't think you need all the Nav2 specific code, you can reproduce this using the buffer alone. Is certainly a problem, but its a problem for TF2. |
Any update here? |
I created an Issue for tf2_ros : ros2/geometry2#460 (comment) |
Awesome! Closing here since it has motion elsewhere |
Bug report
Steps to reproduce issue
Create a costmap_2D with some plugins.
Then repeatedly configure - activate - deactivate - cleanup.
Expected behavior
The costmap is repeatedly activated and deactivated without a crash.
Actual behavior
After some time, the node crash due to a segfault.
Additional information
Using backward_ros I got this detailed failure.
This crash is due to the tf2_ros
waitForTransform
function that creates a timer to call a callback:https://github.com/ros2/geometry2/blob/8e508d01789803334dfcd59ba277cb49c0ea4219/tf2_ros/src/buffer.cpp#L258-L261
When cleaning the costmap, the callback function doesn't exist anymore hence the timer creates a segfault.
The crash happens after the call of
tf_buffer_->canTransform
:https://github.com/ros-planning/navigation2/blob/e5a4c844c748233dc4d3039b1ea5809c81dac45f/nav2_costmap_2d/src/costmap_2d_ros.cpp#L219-L221
My false fix
To avoid this crash I added a delay(transform_tolerance_) between deactivate() and cleanup().
The best way might be to secure tf2_ros but I may not have the skills to fix it.
The text was updated successfully, but these errors were encountered: