Skip to content

Fix crash for invalid index in force torque GUI plugin (backport #3601)#3632

Open
mergify[bot] wants to merge 1 commit into
ign-gazebo6from
mergify/bp/ign-gazebo6/pr-3601
Open

Fix crash for invalid index in force torque GUI plugin (backport #3601)#3632
mergify[bot] wants to merge 1 commit into
ign-gazebo6from
mergify/bp/ign-gazebo6/pr-3601

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 29, 2026

🦟 Bug fix

Fixes crash when selecting models and the ApplyForceTorque plugin is loaded.

Summary

Originally found by @iche033 in intrinsic-dev/aic#553, it seems that due to a race condition sometimes the linkIndex is set to an uninitialized value (-1). We then try to do an array access with that index and crash.
Just added a boundary check so we don't do that until the next call to the Update function.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.


This is an automatic backport of pull request #3601 done by Mergify.

Originally found by @iche033 in intrinsic-dev/aic#553, it seems that due to a race condition sometimes the linkIndex is set to an uninitialized value (-1). We then try to do an array access with that index and crash.
Just added a boundary check so we don't do that until the next call to the Update function.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Co-authored-by: Arjo Chakravarty <arjoc@intrinsic.ai>
(cherry picked from commit de5e2a2)

# Conflicts:
#	src/gui/plugins/apply_force_torque/ApplyForceTorque.cc
@mergify mergify Bot requested a review from arjo129 as a code owner May 29, 2026 06:15
@mergify mergify Bot added the conflicts label May 29, 2026
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented May 29, 2026

Cherry-pick of de5e2a2 has failed:

On branch mergify/bp/ign-gazebo6/pr-3601
Your branch is up to date with 'origin/ign-gazebo6'.

You are currently cherry-picking commit de5e2a21.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   src/gui/plugins/apply_force_torque/ApplyForceTorque.cc

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants