-
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 occurs during costmap-calculation of controller_server
#4323
Comments
Additional Informationan experimentstep 0. insert a delay into the function: bool
Costmap2DROS::getRobotPose(geometry_msgs::msg::PoseStamped & global_pose)
{
std::this_thread::sleep_for(std::chrono::seconds(10));
RCLCPP_INFO(get_logger(),"[GOES|DEBUG] after insesrt");
return nav2_util::getCurrentPose(
global_pose, *tf_buffer_,
global_frame_, robot_base_frame_, transform_tolerance_);
} step 1. launch the nav2 step 2. send a Nav2Goal step 3. Ctrl+C to navigation2 before it finished the goal step 4. then, we could get a similar Asan report stablely.
And part of the log info is as following:
a conclusion from the experimentit proves that , the Also, I noticed that some
I'd further check why the error log occured. |
Seems like a lifecycle thing that just needs to be reordered 👍 |
@GoesM any update? |
Yeah, it's finally confirmed that the navigation2/nav2_costmap_2d/src/costmap_2d_ros.cpp Lines 288 to 306 in cf3dd55
doing so , we could make sure that the thread wouldn't access the pointer which has been freed before. Shall I open a PR for this ISSUE ? |
Please! |
Bug report
Required Info:
Steps to reproduce issue
Just launch the navigation2 normally, as following steps:
And finally sent Ctrl+C to shutdown navigation2.
An ASAN report file was discovered in my execution environment.
Expected behavior
no bug occured.
Actual behavior
The ASAN reporting a use-after-free bug to me, as following:
Additional information
Accroding to the ASAN report ,
it seems that
global_pose
variable is changed as a NullPtr whencostmap_ros->getRobotPose
is still running.https://github.com/open-navigation/navigation2/blob/8f097af08ced738f4a0797d941a60d834ebc8d80/nav2_controller/src/controller_server.cpp#L613-L621
The text was updated successfully, but these errors were encountered: