Skip to content

Use a queue to track component registration from mulitiple sources #1836

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

Merged
merged 7 commits into from
Feb 18, 2023

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Dec 9, 2022

🦟 Bug fix

Fixes #1780, #806

Summary

When a plugin gets unloaded, the component types it registered will have invalid component descriptors. Attempting to create new components of those types will result in a segfault. This PR is an attempt to fix that by keeping track all component registrations and removing invalid ones when plugins get unloaded.

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.

@azeey azeey self-assigned this Dec 9, 2022
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Dec 9, 2022
@azeey azeey force-pushed the fix_comp_registration branch from 7b94729 to e190c51 Compare December 9, 2022 03:07
@azeey azeey force-pushed the fix_comp_registration branch from e190c51 to 10e1174 Compare December 9, 2022 03:10
@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #1836 (ba988b4) into ign-gazebo6 (0960498) will increase coverage by 0.02%.
The diff coverage is 95.91%.

❗ Current head ba988b4 differs from pull request most recent head cf5808b. Consider uploading reports for the commit cf5808b to get more accurate results

@@               Coverage Diff               @@
##           ign-gazebo6    #1836      +/-   ##
===============================================
+ Coverage        64.80%   64.83%   +0.02%     
===============================================
  Files              322      323       +1     
  Lines            26391    26416      +25     
===============================================
+ Hits             17104    17127      +23     
- Misses            9287     9289       +2     
Impacted Files Coverage Δ
include/ignition/gazebo/components/Component.hh 100.00% <ø> (ø)
include/ignition/gazebo/components/Factory.hh 98.03% <95.74%> (-0.67%) ⬇️
src/ComponentFactory.cc 100.00% <100.00%> (ø)
src/Util.cc 93.11% <0.00%> (-0.33%) ⬇️
.../gui/plugins/transform_control/TransformControl.cc 7.34% <0.00%> (-0.02%) ⬇️
...rc/systems/ackermann_steering/AckermannSteering.cc 85.67% <0.00%> (+0.16%) ⬆️

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

@azeey azeey marked this pull request as ready for review December 22, 2022 19:52
@azeey azeey requested a review from mjcarroll as a code owner December 22, 2022 19:52
Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

I think you can go ahead and add the peer gz headers here as well.

Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

Approach looks good, some small nits.

I think it's probably wise to go ahead and forward port this one by itself while you have context, as there are quite a few TODOs introduced here.

Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

LGTM, sorry about the gz header confusion, I thought we had made it this far.

@azeey
Copy link
Contributor Author

azeey commented Feb 8, 2023

Building on Ubuntu one more time to see if the INTEGRATION_recreate_entities test failures is caused by this PR Build Status

@azeey
Copy link
Contributor Author

azeey commented Feb 16, 2023

INTEGRATION_recreate_entities continues to fail. gazebosim/gz-physics#480 should fix it.

@azeey
Copy link
Contributor Author

azeey commented Feb 18, 2023

@osrf-jenkins run tests please

@azeey azeey merged commit 57fd150 into gazebosim:ign-gazebo6 Feb 18, 2023
azeey added a commit to azeey/gz-sim that referenced this pull request Mar 21, 2023
…azebosim#1836)

When a plugin gets unloaded, the component types it registered will have invalid component descriptors. Attempting to create new components of those types will result in a segfault. This PR is an attempt to fix that by keeping track of all component registrations and removing invalid ones when plugins get unloaded.

---------

Signed-off-by: Addisu Z. Taddese <[email protected]>
azeey added a commit that referenced this pull request Mar 30, 2023
…1836)

When a plugin gets unloaded, the component types it registered will have invalid component descriptors. Attempting to create new components of those types will result in a segfault. This PR is an attempt to fix that by keeping track of all component registrations and removing invalid ones when plugins get unloaded.

---------

Signed-off-by: Addisu Z. Taddese <[email protected]>
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