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 memory corruption due to faulty refcount tracking #480

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Feb 16, 2023

🦟 Bug fix

Summary

The memory corruption seems to occur only on DART 6.9.2 (version that comes with Ubuntu 20.04), but not 6.12 (Ubuntu 22.04), so I'm led to believe it's a bug in dart that has since been fixed. But the patch in this PR seems to avoid the problem by not storing the freejoint created when creating links. My suspicion is that this freejoint is not properly taken into account when removing skeletons.

This is blocking gazebosim/gz-sim#1836 as the test INTEGRATION_recreate_entities is reliably failing on CI. Running the test under valgrind shows that a memory corruption occurs while trying to decrement a reference count of a skeleton. With this patch, the valgrind error goes away.

Checklist

  • Signed all commits for DCO
  • 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)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey self-assigned this Feb 16, 2023
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Feb 16, 2023
@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Merging #480 (8feceb1) into ign-physics5 (b18faf2) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 8feceb1 differs from pull request most recent head 7121b72. Consider uploading reports for the commit 7121b72 to get more accurate results

@@               Coverage Diff                @@
##           ign-physics5     #480      +/-   ##
================================================
- Coverage         76.35%   76.35%   -0.01%     
================================================
  Files               129      129              
  Lines              5811     5810       -1     
================================================
- Hits               4437     4436       -1     
  Misses             1374     1374              
Impacted Files Coverage Δ
dartsim/src/SDFFeatures.cc 62.65% <ø> (-0.08%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@azeey azeey merged commit 48216e9 into gazebosim:ign-physics5 Feb 16, 2023
@azeey azeey deleted the fix_refcount_issue branch February 16, 2023 19:39
@azeey azeey mentioned this pull request Mar 27, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants