Repository navigation
Release wait sets and clients that the tests leak - #3455
Merged
Merged
Conversation
test_graph_listener, and the is_ready tests of the action client and generic client, initialize an rcl wait set by hand and never finalize it. construction_and_destruction_rcl_errors replaces rcl_action_client_fini() with a function that only returns an error, so the client is never finalized. Finalize the wait sets, and call the real rcl_action_client_fini() before injecting the error. Found with LeakSanitizer. Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
ABI Compliance Check✅ Verdict: compatible
✅
|
christophebedard
approved these changes
Nov 28, 2026
| { | ||
| { | ||
| auto mock = mocking_utils::patch_and_return( | ||
| auto mock = mocking_utils::inject_on_return( |
Member
There was a problem hiding this comment.
argh, I've made so many similar fixes. It's so easy to overlook the leaks this causes at this level.
Member
Author
There was a problem hiding this comment.
Yep, I'm excited to be in a place where we can consistently run everything under ASan again.
Member
Author
This was referenced Nov 29, 2026
…ashes on RHEL Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
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
Several tests leak rcl objects, which LeakSanitizer reports:
test_graph_listener: five tests callinit_wait_set()through the test helper and never finalize the wait set. They now callmock_cleanup_wait_set()at the end, like the other tests in that file.test_graph_listener_shutdown_wait_fini_error_throwstarted the fixture's listener but cleaned up a different, unused one, so it now uses the one it starts.rclcpp_actionTestClient.is_readyandTestGenericClient.is_readynever callrcl_wait_set_fini()on the wait set they create.TestClient.construction_and_destruction_rcl_errorsreplacedrcl_action_client_fini()with a function that only returns an error, so the client was never finalized. It usesinject_on_returnnow, which calls the real function first.Test only. Found with AddressSanitizer, which is clean for these three targets after the change.
Is this user-facing behavior change?
No.
Did you use Generative AI?
Yes, Claude Code, for finding the causes and writing the change. Tested with AddressSanitizer.
Additional Information