-
Notifications
You must be signed in to change notification settings - Fork 364
heap-use-after-free thrown in tests #1588
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
Comments
I digged a little deeper and using some debug output it is pretty clear what's going on:
This could potentially be mitigated by making sure to delete the controller before the command interfaces get deleted in that particular case, but that would still leave the potential for this to happen rather large. If the @mamueluth @saikishor as you have touched the |
@fmauch I've already tried to do this change months back. Unfortunately, this is a breaking change as most of the tests use it. We will surely do it in rolling after we branch off. However, I can think of another easy fix for these situations |
@fmauch Can you give it a shot with ros-controls/ros2_control#2112? This should most likely fix it |
I'll give it a shot, yes! Edit: Nope, that seems to be too late:
A workaround would probably have to be done in the test itself. |
Most likely yes :( |
JTC got fixed with #1596, follow-up issue for the other controllers is pending |
Describe the bug
Running the JTC tests with ASAN enabled raises a heap-use-after-free error. I stumbled upon this while writing tests for #1191 where I get crashes on some configurations. Tracing things down I realized that there are memory issues reported also on the master branch and I would like to get them fixed, first.
It seems that the destructor of a loaned interface is called while its memory is freed already.
To Reproduce
Steps to reproduce the behavior:
--mixin asan-gcc
)export ASAN_OPTIONS=new_delete_type_mismatch=0
(they are thrown from rclcpp and make using asan quite useless otherwise)colcon test --event-handlers=console_direct+ --packages-select joint_trajectory_controller --ctest-args -R test_trajectory_actions
4. See errorExpected behavior
No crashes ;-)
Screenshots
Running the test in a debugger (without asan) and watching the first line (
auto logger = rclcpp::get_logger(state_interface_.get_name());
) in the destructor yielded for example:Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: