-
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
NullPtr bug during the getRobotPose()
calculation of costmap_ros_
in nav2_controller
#4437
Comments
Yeah! Can you submit the backport PR to Humble? Happy to review/merge! |
My pleasure ^_^ I also have a check on |
7 tasks
Merged! |
Sure! |
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Required Info:
Steps to reproduce issue
Launch the navigation2 normally, as following steps:
Expected behavior
no NullPtr bug occured.
Actual behavior
the Asan report of this NullPtr bug is as following:
Additional information
It's a shutdown-issue
First, based on my execution logs, I can confirm this is a shutdown issue.
the casue analysis
Below is an analysis of the cause of this bug:
The action_server_ binds the computeControl() function as a callback function:
navigation2/nav2_controller/src/controller_server.cpp
Lines 228 to 234 in 635880d
Therefore, when the action_server_ receives a task command, it will invoke the function path computeControl() -> computeAndPublishVelocity():
navigation2/nav2_controller/src/controller_server.cpp
Line 482 in 635880d
The
computeAndPublishVelocity()
function directly uses the functiongetRobotPose()
ofcostmap_ros_
for calculations:navigation2/nav2_controller/src/controller_server.cpp
Lines 584 to 591 in 635880d
This causes the
action_server_
to access the internal memory ofcostmap_ros_
during thegetRobotPose()
execution. However, it should be noted that :although
nav2_costmap_ros
is a plugin, it is also an independent ROS2-LifecycleNode that actively responds to exit signals.Therefore,
costmap_ros
might respond to signals fromrclcpp::ok()
and exit earlier than thier parent-LifecycleNode, nav2_controller.If this response sequence occurs,
costmap_ros_
might have already exited and released its memory BUT nav2_controller'saction_server_
is still executing calculations, leading to access of released memory and thus an error.Additional information for the additional information:
Note: This should be a very similar (or even the same) issue occurred with following ISSUEs , in which here're our previous discussion and fix into
main
branch:#3971 (comment)
#3972 (comment)
I noticed that such fix is deployed into
main
but not intohumble
so that the similar bug occurs again.suggestion
Shall we push such change for
costmap_ros_
frommain
intohumble
?The text was updated successfully, but these errors were encountered: