Skip to content

Fix findWayPointIndicesForDurationAfterStart method when out of bounds (backport #3626) - #3874

Merged
nbbrooks merged 1 commit into
moveit:jazzyfrom
130s:jazzy-backport-pr3626
Oct 26, 2026
Merged

nbbrooks merged 1 commit into
moveit:jazzyfrom
130s:jazzy-backport-pr3626

Conversation

@130s

@130s 130s commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Backport of #3626 to jazzy.

Original PR: #3626
Author: @XingxinHE

Description

The fix addresses the bug raised in issue #3612 which causes undefined behavior / out-of-bounds memory access:

  • When duration >= total_duration or waypoints_.empty(), index reached num_points, leading to out-of-bounds access on duration_from_previous_[index].
  • Replaced unchecked indexing with .at() and added boundary checks for empty waypoints and negative durations.
  • Includes unit tests covering out-of-bounds, single waypoint, and empty trajectory edge cases.

Checklist

  • Required by CI: Code is auto formatted
  • Tests included

moveit#3626)

* Fix findWayPointIndicesForDurationAfterStart method when out of bounds and add unit tests

* Use .at() to index deque; Add 2 more edge test cases

* Revise function comments

---------

Co-authored-by: Nathan Brooks <[email protected]>
Co-authored-by: Ezra Brooks <[email protected]>
(cherry picked from commit 4287c80)
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5d4ec6ce-af83-44e4-b410-107e25fe783b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Sep 25, 2026

Copy link
Copy Markdown

Please target the main branch for development, we will backport the changes to jazzy for you if approved and if they don't break API.

@130s
130s requested a review from nbbrooks September 25, 2026 15:33
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.35%. Comparing base (002f40e) to head (8e12478).

Additional details and impacted files
@@            Coverage Diff             @@
##            jazzy    #3874      +/-   ##
==========================================
+ Coverage   46.25%   46.35%   +0.10%     
==========================================
  Files         718      718              
  Lines       59188    59232      +44     
  Branches     7598     7601       +3     
==========================================
+ Hits        27374    27449      +75     
+ Misses      31650    31617      -33     
- Partials      164      166       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@130s 130s mentioned this pull request Sep 28, 2026
@nbbrooks
nbbrooks merged commit 1d95e7e into moveit:jazzy Oct 26, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in MoveIt Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants