Skip to content
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

fix(route_handler): exception in route_handler caused by int overflow #6755

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

sebekx
Copy link
Contributor

@sebekx sebekx commented Apr 5, 2024

Description

Removed cast to int which cause overflow and exception when lanelet id is greater than int. verified that lanelet.Id is type int64

Tests performed

before, exception was thrown because could not find element with negative id :
image

after there is no exception

Effects on system behavior

Fix exception in case when lanelet contains larger ids (int could not handle)

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.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Apr 5, 2024
@sebekx sebekx changed the title Fix exception in route_handler cause by int overflow fix exception in route_handler cause by int overflow Apr 5, 2024
@sebekx sebekx changed the title fix exception in route_handler cause by int overflow fix: exception in route_handler cause by int overflow Apr 5, 2024
Signed-off-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
@sebekx sebekx changed the title fix: exception in route_handler cause by int overflow fix(route_handler): exception in route_handler cause by int overflow Apr 5, 2024
@sebekx sebekx changed the title fix(route_handler): exception in route_handler cause by int overflow fix(route_handler): exception in route_handler caused by int overflow Apr 5, 2024
Copy link
Contributor

@soblin soblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@soblin
Copy link
Contributor

soblin commented Apr 5, 2024

It looks like we need to care invalid narrowing conversion throughout the codebase for better quality.

@shmpwk shmpwk added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 6, 2024
@shmpwk shmpwk enabled auto-merge (squash) April 6, 2024 03:02
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 14.93%. Comparing base (1eef4c0) to head (6617ec1).

Files Patch % Lines
planning/route_handler/src/route_handler.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6755   +/-   ##
=======================================
  Coverage   14.93%   14.93%           
=======================================
  Files        1944     1944           
  Lines      134061   134061           
  Branches    39891    39891           
=======================================
  Hits        20025    20025           
  Misses      91735    91735           
  Partials    22301    22301           
Flag Coverage Δ *Carryforward flag
differential 14.81% <0.00%> (?)
total 14.93% <ø> (+<0.01%) ⬆️ Carriedforward from 1eef4c0

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shmpwk shmpwk merged commit 35642a6 into autowarefoundation:main Apr 6, 2024
40 of 43 checks passed
@sebekx sebekx deleted the fix-route-handler branch April 7, 2024 17:58
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Apr 8, 2024
…autowarefoundation#6755)

Remove cast to int which might cause overflow

Signed-off-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
Co-authored-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
esteve pushed a commit that referenced this pull request Apr 9, 2024
…#6755)

Remove cast to int which might cause overflow

Signed-off-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
Co-authored-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…autowarefoundation#6755)

Remove cast to int which might cause overflow

Signed-off-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
Co-authored-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants