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

Not finalize guard condition while destructing SubscriptionIntraProcess #1306

Closed
Barry-Xu-2018 opened this issue Sep 11, 2020 · 1 comment
Closed

Comments

@Barry-Xu-2018
Copy link
Collaborator

Bug report

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

Steps to reproduce issue

$ colcon build --packages-up-to rclcpp --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug
$ source install/setup.bash
$ valgrind --leak-check=full ./build/rclcpp/test/test_subscription

Expected behavior

No memory leak

Actual behavior

Memory leak occur

==190768== 
==190768== HEAP SUMMARY:
==190768==     in use at exit: 46,900 bytes in 100 blocks
==190768==   total heap usage: 10,538 allocs, 10,438 frees, 4,416,678 bytes allocated
==190768== 
==190768== 144 (56 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 24 of 34
==190768==    at 0x483F7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==190768==    by 0x50FBF46: __default_allocate (allocator.c:37)
==190768==    by 0x508B690: __rcl_guard_condition_init_from_rmw_impl (guard_condition.c:73)
==190768==    by 0x508B842: rcl_guard_condition_init (guard_condition.c:108)
==190768==    by 0x4F20E4E: rclcpp::experimental::SubscriptionIntraProcess<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void>, std::default_delete<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >, rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >::SubscriptionIntraProcess(rclcpp::AnySubscriptionCallback<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void> >, std::shared_ptr<std::allocator<void> >, std::shared_ptr<rclcpp::Context>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rmw_qos_profile_t, rclcpp::IntraProcessBufferType) (subscription_intra_process.hpp:86)
==190768==    by 0x4F1F8A3: void __gnu_cxx::new_allocator<rclcpp::experimental::SubscriptionIntraProcess<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void>, std::default_delete<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >, rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > > >::construct<rclcpp::experimental::SubscriptionIntraProcess<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void>, std::default_delete<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >, rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >, rclcpp::AnySubscriptionCallback<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void> >&, std::shared_ptr<std::allocator<void> >, std::shared_ptr<rclcpp::Context>&, char const*, rmw_qos_profile_t&, rclcpp::IntraProcessBufferType>(rclcpp::experimental::SubscriptionIntraProcess<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void>, std::default_delete<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >, rcl_interfaces::msg::ParameterEvent_<std::allocator<void> > >*, rclcpp::AnySubscriptionCallback<rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >, std::allocator<void> >&, std::shared_ptr<std::allocator<void> >&&, std::shared_ptr<rclcpp::Context>&, char const*&&, rmw_qos_profile_t&, rclcpp::IntraProcessBufferType&&) (new_allocator.h:147)
...
@Barry-Xu-2018
Copy link
Collaborator Author

The fixing #1307 has been merged.
So close this issue.

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

No branches or pull requests

1 participant