-
Notifications
You must be signed in to change notification settings - Fork 68
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
Memory leak: message_filters::Synchronizer heap-use-after-free #66
Comments
The OS distribution I'm working on is Ubuntu 20.04 and the GCC version is 9.3.0. You can get all the necessary files from this repo and also get the log output in the repo root directory. The command we use to build the package is |
I took a bit of a look at this. The problem is in the order of destruction between If you reverse the order of the That said, this is pretty subtle and pretty fragile. It would be best if the
to something like:
Another alternative would be to have There may be other ways we could go here. @ros2/team thoughts? |
The reference counted pointer is likely the cleanest. We just need to make sure it's not too easy to make a loop of dependencies that will block destruction. |
Hi @clalancette, thanks for your reply, the heap-use-after-free problem goes away after I reverse the order but a new memory leak problem is generated. Here is what I got:
And I see your discussion on this related issue, so is that means I need to re-build rclcpp from source on foxy branch to fix this new problem? |
I'm actually going to leave this open, since we do need to address the connecting inputs problem. |
Hi,
I'm working on ROS2 with Foxy version and in my project I find memory leak in
message_filters::Synchronizer
when testing with Sanitizer tool. So I write a small test case, then find that when shutting down the node, there is 8 bytes heap-use-after-free issue inmessage_filters::Signal1<sensor_msgs::msg::Image_<std::allocator<void> > >::removeCallback
. Here is the code.Regards,
Han
The text was updated successfully, but these errors were encountered: