Comments (7)
Ah... I think the situation here might be a bit different and not suitable for validation through validageMsg()
.
In my understanding, nav2_util::validateMsg()
is a generic check mainly for nan
, inf
, and similar requirements that all messages of the same msg-type should meet. However, the error here is caused by a large value of x in a specific calculation process of nav2_amcl
.
And I believe it's more appropriate to perform the check in the callback process of /initialpose
in nav2_amcl
, rather than adding conditions to nav2_util::validateMsg()
. There are two main reasons for this:
- The requirement for the "extreme value" seems to be specific to
nav2_amcl
and may not apply to all messages of this msg-type. - Exactly setting an appropriate value for the "extreme value" doesn't have a precise answer. Because it might depend on factors such as the size of the map where
nav2
operates and the specific circumstances of other packages that use the message ofPoseWithCovarianceStamped
type.
Overall, I think agreeing on an upper limit for x and implementing it in the callback process of nav2_amcl
would be more appropriate.
However, I'm still checking the specific line of code where the overflow occurs and haven't confirmed it yet. I think here would be a better method to fix it after a further check.
SO, I'd further confirm the specific line of code causing the buffer overflow and investigate why JUST a large value (still in the range of integer
) here could lead to a heap-buffer-overflow.
from navigation2.
You know what to do 😉
from navigation2.
And I believe it's more appropriate to perform the check in the callback process of /initialpose in nav2_amcl
Ok! I trust your opinion 😄 Let me know what you think is best!
from navigation2.
@GoesM any update?
from navigation2.
I'm so sorry for my late work about this issue because I'm struggled by other works. T_T
After the updating humble-branch, validateMsg()
is deployed so the command to reproduce this issue needs some little change, as I'd edited it.
Additional Information:
**which code-line met to heap-buffer-overflow
I insert code for log as following:
void goes_debug(int cnt){
fprintf(stderr, "[GOES|DEBUG]:---------- %d \n", cnt);
}
// Re-compute the cluster statistics for a sample set
void pf_cluster_stats(pf_t * pf, pf_sample_set_t * set)
{
...
...
goes_debug(3);
// Compute cluster stats
for (i = 0; i < set->sample_count; i++) {
...
...
goes_debug(4);
cluster = set->clusters + cidx;
goes_debug(5);
cluster->weight += sample->weight;
goes_debug(6);
weight += sample->weight;
goes_debug(7);
...
...
}
...
}
And I catched the log during the crash:
[amcl-7] [INFO] [1717073213.332957908] [amcl]: Setting pose (5.019000): -751613824.000 0.378 3.142
[amcl-7] [GOES|DEBUG]:---------- 1
[amcl-7] [GOES|DEBUG]:---------- 2
[amcl-7] [GOES|DEBUG]:---------- 3
[amcl-7] [GOES|DEBUG]:---------- 4
[amcl-7] [GOES|DEBUG]:---------- 5
[amcl-7] [GOES|DEBUG]:---------- 6
[amcl-7] [GOES|DEBUG]:---------- 7
[amcl-7] [GOES|DEBUG]:---------- 4
[amcl-7] [GOES|DEBUG]:---------- 5
[ERROR] [amcl-7]: process has died [pid 111426, exit code 1, cmd '/home/goes/ROS_Workstation/humble_fork/install/nav2_amcl/lib/nav2_amcl/amcl --ros-args --log-level info --ros-args -r __node:=amcl --params-file /tmp/launch_params_t5mx02k0 -r /tf:=tf -r /tf_static:=tf_static'].
It proves that the bug occurs in line:
navigation2/nav2_amcl/src/pf/pf.c
Line 521 in cf3dd55
And it seems like cluster = set->clusters +cidx
would let the cluster
became an invalidate pointer.
from navigation2.
However, I am not an expert about the pf-calculation , and not clear whether such buffer-overflow is related to the size of map or not ?
If related to , I think we could add a check to ensure that the received pose is within the map range ?
from navigation2.
Sure! That seems sensible
from navigation2.
Related Issues (20)
- Full footprint collsion distance in MPPI obstacle critic and use of collision_margin_distance. HOT 13
- local_costmap does not respect the use_sim_time parameter HOT 12
- Vector polygon - Collision Monitor is not available for ROS2 humble HOT 5
- [collision_monitor] Add temporal axis to min_points behavior HOT 2
- [ERROR] [1716697697.080277840] [rviz2]: Lookup would require extrapolation into the future. Requested time 1716697697.040514 but the latest data is at time 1716697697.039929, when looking up transform from frame [laser_frame] to frame [odom]
- Laser Scan rotates with robot ------- [ERROR] [1716697697.080277840] [rviz2]: Lookup would require extrapolation into the future. Requested time 1716697697.040514 but the latest data is at time 1716697697.039929, when looking up transform from frame [laser_frame] to frame [odom] HOT 1
- [for help] action `follow_path` doesn't work (humble) HOT 7
- Changing the params file HOT 1
- Understand MPPI Critics and parameters HOT 2
- 18 bugs (UAF) in `nav2_amcl` by setting dynamic parameters HOT 6
- MPPI ARM Binaries Issue HOT 9
- velocity smoother deadband velocity as an interval HOT 4
- Remove old Gazebo stuff once new gazebo lands HOT 9
- revisit nav2_behavior_tree workarounds HOT 3
- test_decorator_speed_controller complains about not finding template specialization (but succeeds) HOT 3
- Caching SmacPlannerHybrid's dist_heuristic_lookup_table HOT 1
- Issue on Starting up Nav 2 HOT 2
- Complete Port to modern Gazebo List
- Add in optional keepout / speed zones for example in new warehouse maps
- [AMCL] Robot pose's covariance on turns HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from navigation2.