Keep callback-group guard conditions alive in Executor#3114
Open
ralwing wants to merge 2 commits intoros2:humblefrom
Open
Keep callback-group guard conditions alive in Executor#3114ralwing wants to merge 2 commits intoros2:humblefrom
ralwing wants to merge 2 commits intoros2:humblefrom
Conversation
Store callback-group notify guard conditions in the executor map with shared ownership instead of raw pointers. This prevents guard conditions from being finalized while still referenced by the memory strategy during wait set rebuilds, avoiding intermittent 'failed to add guard condition to wait set: guard condition implementation is invalid' crashes under callback-group destruction races. (cherry picked from commit 7c8ce04) Signed-off-by: Grzegorz Głowacki <gglowacki@autonomous-systems.pl>
Signed-off-by: Grzegorz Głowacki <gglowacki@autonomous-systems.pl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request updates the
ExecutorEntitiesCollectorclass to improve the management of guard condition pointers. The most important change is switching from weak pointers to shared pointers for guard conditions in internal maps, which helps prevent premature destruction and potential use-after-free errors.Pointer management improvements:
WeakNodesToGuardConditionsMapandWeakGroupsToGuardConditionsMapfromrclcpp::GuardCondition::WeakPtrtorclcpp::GuardCondition::SharedPtrinexecutor_entities_collector.hpp. This ensures guard conditions remain alive as long as they're needed by the executor.Fixes #2163 autowarefoundation/autoware_core#694 ros2/rmw_zenoh#608 autowarefoundation/autoware_universe#6452
According to #2820 (comment) it's already fixed in rolling 2025.4
Is this user-facing behavior change?
This breaks the downstream ABI. All libraries must be rebuilt.
Did you use Generative AI?
I used GitHub Copilot model Claude-Opus: 4.6