-
Notifications
You must be signed in to change notification settings - Fork 117
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
Not call Domain::removePublisher while rmw_publisher_allocate return failure in rmw_fastrtps_cpp/dynamic_cpp::create_publisher #433
Comments
After investigating, find the cause While rmw_fastrtps/rmw_fastrtps_cpp/src/publisher.cpp Lines 169 to 173 in 4dc7379
The clear function is called rmw_fastrtps/rmw_fastrtps_cpp/src/publisher.cpp Lines 107 to 114 in 4dc7379
In above codes, it doesn't remove created publisher in here. rmw_fastrtps/rmw_fastrtps_cpp/src/publisher.cpp Lines 157 to 173 in 4dc7379
|
…os2#433) Signed-off-by: Barry Xu <barry.xu@sony.com>
Besides, find an issue for current implementation of subscription. In subscription.cpp(), clear action includes rmw_fastrtps/rmw_fastrtps_cpp/src/subscription.cpp Lines 108 to 119 in 4dc7379
But above sequence seems to be a problem. If subscriber also exists, type will not be unregistered. So |
i think so too. if any related publication or subscription with type_support, that type_support cannot be unregistered / deleted. |
Thanks for confirmation. |
I have added fixing #437. |
Bug report
- Operating System:
Ubuntu 20.04
- Installation type:
source
- Version or commit hash:
4dc7379
- DDS implementation:
fastrtps
- Client library (if applicable):
rcl
Steps to reproduce issue
Expected behavior
No memory leak.
Actual behavior
Memory leak happens
==225597== 344 (240 direct, 104 indirect) bytes in 2 blocks are definitely lost in loss record 16 of 19
==225597== at 0x48400F3: operator new(unsigned long, std::nothrow_t const&) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==225597== by 0x50CD229: rmw_fastrtps_cpp::create_publisher(CustomParticipantInfo const*, rosidl_message_type_support_t const*, char const*, rmw_qos_profile_t const*, rmw_publisher_options_t const*, bool, bool) (publisher.cpp:125)
==225597== by 0x50C63DD: init_context_impl(rmw_context_t*) (init_rmw_context_impl.cpp:107)
==225597== by 0x50C69C7: rmw_fastrtps_cpp::increment_context_impl_ref_count(rmw_context_t*) (init_rmw_context_impl.cpp:195)
==225597== by 0x50E09B1: rmw_create_node (rmw_node.cpp:60)
==225597== by 0x486D4C0: rcl_node_init (node.c:257)
==225597== by 0x176895: TestNodeFixture__rmw_fastrtps_cpp_test_rcl_node_init_with_internal_errors_Test::TestBody() (test_node.cpp:524)
==225597== by 0x1F0275: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const) (gtest.cc:2447)
==225597== by 0x1E922C: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const) (gtest.cc:2483)
==225597== by 0x1C5925: testing::Test::Run() (gtest.cc:2522)
==225597== by 0x1C631E: testing::TestInfo::Run() (gtest.cc:2703)
==225597== by 0x1C6A0F: testing::TestCase::Run() (gtest.cc:2825)
The text was updated successfully, but these errors were encountered: