-
Notifications
You must be signed in to change notification settings - Fork 29
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
Static Allocator - Aligned allocations #31
Conversation
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@thomas-moulard Can you please run CI for this PR? Unfortunately we cannot restrict the test or build packages very much. Gist: https://gist.githubusercontent.com/emersonknapp/c3646b3d48b6ad07b1c9144eac98dff7/raw/fdc4bae8a7a945f689c6748cf6fc66187b61df5c/ros2.repos |
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
305400e
to
d11a5af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, we could clean up a few things but it's fairly minor. This PR lacks unit tests.
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
Any thoughts on how to unit test this? I am not able to reproduce the observed problem in a toy example - only in the context of a specific system dynamically linking against OpenSSL, using an optimized build of glibc6 |
@thomas-moulard The build failed because my arguments were wrong - the test and build args should have been: --packages-up-to test_rclcpp test_communication test_cli test_cli_remapping rclpy |
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
What about instantiating a static allocator in the unit test and checking the addresses are actually aligned? |
osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp
Outdated
Show resolved
Hide resolved
In general, looks good to me. It might fix aarch64 too, since we've had alignment issue on ARM in the past. Thanks for looking into it, I know the code is hairy :x |
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for considering adding unit tests. I don't think that I need to take another pass on this so I'll LGTM it now 👍
@wjwwood I've addressed the formatting concerns and added in the statics. I'm looking at test_memory_tools.cpp and trying to figure how to add a unit test for static_allocator.hpp, which is buried in the source directory. Any ideas on that without having to restructure the project? Other than that, it looks like the test failures on CI were |
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
I've just pushed a commit that is an attempt at exposing the src dir to the tests without restructuring things - lmk if this is ok or if it's a kludge - I wouldn't consider myself enough of a CMake expert to determine. |
Here's the issue for the known flake ros2/build_farmer#166 |
Regarding time source test failures in above - I am able to reproduce those locally on master ros2.repos without this patch. As for this patch, I believe the only packages this really affects are Locally, if I run the
But with this patch, 100% of rcl tests pass. I don't know if the buildfarm is witnessing the same segfaults - it is possible that it is a very subtle combination of variables. It would be nice to see the current state of master compared to this build for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look okay to me. I'll trigger a set of builds for comparison.
I guess after ros2/rmw_fastrtps#272, we can't expect Fast-RTPS 1.7 to build. Edit: I've re-triggered with |
The CI results are a strict improvement over the current master. Merging... |
main
symbolFixes #30
Unblocks ros2/rmw_fastrtps#272
Signed-off-by: Emerson Knapp eknapp@amazon.com