Skip to content
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

rcl_[publisher/subscription]_event_init not to deallocate event->impl if not return successfully #789

Closed
iuhilnehc-ynos opened this issue Sep 4, 2020 · 0 comments · Fixed by #790

Comments

@iuhilnehc-ynos
Copy link
Collaborator

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • source
  • Version or commit hash:
  • DDS implementation:
    • cyclonedds or fastrtps
  • Client library (if applicable):
    • rcl

Steps to reproduce issue

$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug --packages-up-to rcl
$ . install/setup.bash
$ valgrind --leak-check=full ./build/rcl/test/test_events__rmw_cyclonedds_cpp  // or test_events__rmw_fastrtps_cpp

Expected behavior

No memory leak

Actual behavior

memory leak via valgrind

==255287== 64 bytes in 1 blocks are definitely lost in loss record 4 of 19
==255287==    at 0x483D7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==255287==    by 0x50AFF06: __default_allocate (allocator.c:37)
==255287==    by 0x48626D4: rcl_publisher_event_init (event.c:59)
==255287==    by 0x19AAB1: TestEventFixture_test_bad_event_ini_Test::TestBody() (test_events.cpp:712)
==255287==    by 0x1E1B29: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2447)
==255287==    by 0x1DA768: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2483)
==255287==    by 0x1B638B: testing::Test::Run() (gtest.cc:2522)
==255287==    by 0x1B6D84: testing::TestInfo::Run() (gtest.cc:2703)
==255287==    by 0x1B7475: testing::TestCase::Run() (gtest.cc:2825)
==255287==    by 0x1C2B5E: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:5216)
==255287==    by 0x1E3023: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2447)
==255287==    by 0x1DB87C: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2483)
==255287== 
==255287== 64 bytes in 1 blocks are definitely lost in loss record 5 of 19
==255287==    at 0x483D7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==255287==    by 0x50AFF06: __default_allocate (allocator.c:37)
==255287==    by 0x48628E3: rcl_subscription_event_init (event.c:102)
==255287==    by 0x19AB92: TestEventFixture_test_bad_event_ini_Test::TestBody() (test_events.cpp:719)
==255287==    by 0x1E1B29: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2447)
==255287==    by 0x1DA768: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2483)
==255287==    by 0x1B638B: testing::Test::Run() (gtest.cc:2522)
==255287==    by 0x1B6D84: testing::TestInfo::Run() (gtest.cc:2703)
==255287==    by 0x1B7475: testing::TestCase::Run() (gtest.cc:2825)
==255287==    by 0x1C2B5E: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:5216)
==255287==    by 0x1E3023: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2447)
==255287==    by 0x1DB87C: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2483)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant