Repository navigation
Fix re-adding a node to EventsCBGExecutor after remove_node - #3464
Open
suryakanths wants to merge 1 commit into
Open
suryakanths wants to merge 1 commit into
suryakanths wants to merge 1 commit into
Conversation
Fixes ros2#3418. Signed-off-by: suryakanth <suryakanth@anscer.com>
suryakanths
force-pushed
the
fix-events-cbg-readd-node
branch
from
December 1, 2026 18:41
910fc85 to
3e2ccd8
Compare
Collaborator
|
I'm pretty sure this patch introduces a use after free for events being processed while remove_node is called. I am also currently working on a solution to this. |
Author
|
@jmachowinski Thanks for the review. Can you tell me which object is freed, and in which sequence? I did not find the path by reading the code. I did find a related problem in my patch. A remove and re-add creates a second scheduler handle for the same callback group. The old handle can still be executing, so a mutually exclusive group could run concurrently. I have not reproduced this yet. Since you are working on a solution, I am happy to close this PR in favor of yours. You are welcome to use the regression test. |
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
Removing a node and re-adding it before the executor syncs its callback groups left the node's entities unregistered.
remove_node()now drops the node's callback group entries immediately, so the next sync registers them again. Add a regression test for remove and re-add inside one callback.Fixes #3418
Is this user-facing behavior change?
Yes. A node that is removed and re-added to an
EventsCBGExecutorin quick succession keeps running its timers and subscriptions.Did you use Generative AI?
NO
Additional Information
None