-
Notifications
You must be signed in to change notification settings - Fork 427
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
leak due to std::shared_ptr circular reference between Context and GuardCondition #2497
Comments
Yeah, I did something like this in #2400 on the |
…ardCondition ros2/rclcpp#2497 Signed-off-by: Tomoya Fujita <[email protected]>
i verified with ros2/ros2@4d07f58, reported complain cannot be observed in mainline. @bmartin427 it would be appreciated if you can check and close this issue. |
I tested with |
Bug report
Required Info:
Steps to reproduce issue
Compile the following standalone executable and run with
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp valgrind --leak-check=full
:(Abusing
GuardCondition
as a 'sub-context' here is a simplified stand-in forGraphListener
which is created as a sub-context byNodeGraph
on behalf ofNode
, and itself owns aGuardCondition
constructed with astd::shared_ptr
to the context.)Expected behavior
Optimally, no complaints, however there will be a couple leaks from liblttng-ust.so outside the scope of this issue.
Actual behavior
In addition to the above, this complaint:
Additional information
If using fastDDS the above valgrind complaint will not appear. However I do believe the failure to shut down correctly is the fault of rclcpp and not any rmw implementation: that is, the context and the guard condition both own each other via
std::shared_ptr
s, so neither can ever be deleted. PossiblyGuardCondition
should be holding a weak pointer to the context instead?The text was updated successfully, but these errors were encountered: