-
Notifications
You must be signed in to change notification settings - Fork 181
Fix leaks in rcl_action unit tests #442
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
Conversation
thomas-moulard
left a comment
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
| } | ||
|
|
||
| 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:
Running tests... Test project /home/ANT.AMAZON.COM/prajaktg/ros2_ws/build-asan/rcl_action Start 1: test_action_client 1/15 Test #1: test_action_client ............................ Passed 0.18 sec Start 2: test_action_communication__rmw_fastrtps_cpp 2/15 Test #2: test_action_communication__rmw_fastrtps_cpp ... Passed 0.41 sec Start 3: test_action_interaction__rmw_fastrtps_cpp 3/15 Test #3: test_action_interaction__rmw_fastrtps_cpp ..... Passed 0.18 sec Start 4: test_graph__rmw_fastrtps_cpp 4/15 Test #4: test_graph__rmw_fastrtps_cpp .................. Passed 3.31 sec Start 5: test_action_server 5/15 Test #5: test_action_server ............................ Passed 10.33 sec Start 6: test_goal_handle 6/15 Test #6: test_goal_handle .............................. Passed 0.13 sec Start 7: test_goal_state_machine 7/15 Test #7: test_goal_state_machine ....................... Passed 0.13 sec Start 8: test_types 8/15 Test #8: test_types .................................... Passed 0.13 sec Start 9: test_names 9/15 Test #9: test_names .................................... Passed 0.12 sec Start 10: copyright 10/15 Test #10: copyright ..................................... Passed 0.30 sec Start 11: cppcheck 11/15 Test #11: cppcheck ...................................... Passed 0.66 sec Start 12: cpplint 12/15 Test #12: cpplint ....................................... Passed 1.76 sec Start 13: lint_cmake 13/15 Test #13: lint_cmake .................................... Passed 0.29 sec Start 14: uncrustify 14/15 Test #14: uncrustify .................................... Passed 1.01 sec Start 15: xmllint 15/15 Test #15: xmllint ....................................... Passed 0.40 sec 100% tests passed, 0 tests failed out of 15Signed-off-by: Prajakta Gokhale [email protected]