-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[amcl, move_base] crashed with malformed messages from laser sensor (/scan topic) #1151
Description
Hi, I have done some tests and found some bad crashes on amcl and move_base nodes. Here are the stderr outputs.
amcl: /home/r1/ros1_clang_navigation/src/navigation/amcl/src/amcl/sensors/amcl_laser.cpp:290: static double amcl::AMCLLaser::LikelihoodFieldModel(amcl::AMCLLaserData *, pf_sample_set_t *): Assertion 'pz <= 1.0' failed [amcl-1] process has died [pid 500397, exit code -6, cmd /home/r1/ros1_clang_navigation/devel/lib/amcl/amcl scan:=scan __name:=amcl __log:=/home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/amcl-1.log]. log file: /home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/amcl-1*.log
amcl: /home/r1/ros1_clang_navigation/src/navigation/amcl/src/amcl/sensors/amcl_laser.cpp:291: static double amcl::AMCLLaser::LikelihoodFieldModel(amcl::AMCLLaserData *, pf_sample_set_t *): Assertion 'pz >= 0.0' failed. [amcl-1] process has died [pid 503464, exit code -6, cmd /home/r1/ros1_clang_navigation/devel/lib/amcl/amcl scan:=scan __name:=amcl __log:=/home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/amcl-1.log]. log file: /home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/amcl-1*.log
terminate called after throwing an instance of 'std::runtime_error' what(): Duration is out of dual 32-bit range [move_base-1] process has died [pid 498711, exit code -6, cmd /home/r1/ros1_clang_navigation/devel/lib/move_base/move_base cmd_vel:=/cmd_vel odom:=odom __name:=move_base __log:=/home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/move_base-1.log]. log file: /home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/move_base-1*.log
terminate called after throwing an instance of 'std::runtime_error' what(): Time is out of dual 32-bit range [move_base-1] process has died [pid 499385, exit code -6, cmd /home/r1/ros1_clang_navigation/devel/lib/move_base/move_base cmd_vel:=/cmd_vel odom:=odom __name:=move_base __log:=/home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/move_base-1.log]. log file: /home/r1/.ros/log/bceaf65c-ee8d-11eb-8cea-fba906074cfc/move_base-1*.log
I try to figure out the causes but I'm not very sure.
- In move_base, sensor_msgs/LaserScan.msg:
std_msgs/Header header
float32 angle_min
float32 angle_max
float32 angle_increment
float32 time_increment #it seems the value is below zero or beyond INT_MAX, move_base will crash.
float32 scan_time
float32 range_min
float32 range_max
float32[] ranges
float32[] intensities
- In amcl, navigation/amcl/src/amcl/sensors/amcl_laser.cpp:290:
assert(pz <= 1.0);
assert(pz >= 0.0);
The two asserts disallow strange inputs but they just crash the node. Maybe just discarding the message is a more graceful way?