-
Notifications
You must be signed in to change notification settings - Fork 163
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 leaks in rcl_action unit tests #442
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@thomas-moulard - please run the following CI job:
|
rcl/src/rcl/init.c
Outdated
@@ -179,7 +179,13 @@ rcl_shutdown(rcl_context_t * context) | |||
return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret); | |||
} | |||
|
|||
rcl_ret_t rcl_ret = rcl_logging_fini(); | |||
rcl_ret_t rcl_ret = rcl_context_fini(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this change. I believe it is not assumed that rcl_shutdown
will take care of this memory cleanup. Other places in our code are handling the context finalization alongside rcl_shutdown
, e.g.
rcl/rcl/test/rcl/test_node.cpp
Lines 133 to 134 in 0c4c743
ASSERT_EQ(RCL_RET_OK, rcl_shutdown(&context)); | |
ASSERT_EQ(RCL_RET_OK, rcl_context_fini(&context)); |
It also seems contrary to the documentation of rcl_context_t
: http://docs.ros2.org/latest/api/rcl/structrcl__context__t.html
There is a valid state between shutdown and finalization.
690fa75
to
6a80a9a
Compare
Addressed @jacobperron feedback. |
@thomas-moulard please rerun CI with the latest state. |
Fix memory leaks detected by AddressSanitizer from rcl_action unit tests. Signed-off-by: Prajakta Gokhale <[email protected]>
6a80a9a
to
27bc14a
Compare
Linux failures are unrelated. Looking into it. |
Re-triggered after fixing unrelated regression. |
Fix memory leaks detected by AddressSanitizer from rcl_action unit tests.
Before the fix:
After the fix:
All tests pass after the fixes:
Signed-off-by: Prajakta Gokhale [email protected]