-
Notifications
You must be signed in to change notification settings - Fork 72
fix(lanelet2_extension): invalid access #240
Conversation
if (start_index == 0) { | ||
return lanelet::LineString3d{lanelet::InvalId, points}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask for more detail about how the node side will behave with this change?
I'm curious about whether the node side will work well with lanelet::Invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check how the node behaves actually. But at least this function always returns lanelet::LineString3d{lanelet::InvalId, points};
and I think lanelet::Invalid has no problem.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
==========================================
- Coverage 10.46% 10.46% -0.01%
==========================================
Files 42 42
Lines 3152 3154 +2
Branches 1407 1409 +2
==========================================
Hits 330 330
- Misses 2395 2396 +1
- Partials 427 428 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return optional instead of InvalId
with empty points, and for more strict handling, we should force the callee side to pass linestring with more than 2 points in the future.
Description
This PR prevents
getLineStringFromArcLength
from SIGSEGV.When
linestring.size()
is 0,linestring.size() - 1
can be inf becauselinestring.size()
is unsigned .autoware_common/tmp/lanelet2_extension/lib/utilities.cpp
Line 219 in 0dbf93e
As a result,
linestring[i]
can be invalid access.autoware_common/tmp/lanelet2_extension/lib/utilities.cpp
Line 220 in 0dbf93e
Related links
TIER IV internal slack
Tests performed
We can reproduce this problem.
Download internal rosbag data.
rosbag0
rosbag1
rosbag2
rosbag3
Prepare environment of pilo-auto.xx1:v0.43.6.0.
Execute
ros2 launch autoware_launch logging_simulator.launch.xml map_path:=$HOME/autoware_map/odaiba_beta vehicle_model:=jpntaxi sensor_model:=aip_xx1 localization:=false perception:=false
After launching Step3, play the rosbag from 0 to 3 one by one with remmaping planning topic.
./play_bag_without_planning.sh <rosbag>
linestring.size() - 1
is 18446744073709551615.With this PR, I confirmed there is no SIGSEGV.
Notes for reviewers
N/A
Interface changes
N/A
Effects on system behavior
Fix bug
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.