-
Notifications
You must be signed in to change notification settings - Fork 473
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Bug report
Required Info:
- Operating System:
- ubuntu 2204
- Installation type:
- build from humble branch
- Version or commit hash:
- DDS implementation:
- any one(not related to rmw)
Steps to reproduce issue
build humble according to official guide enabling address sanitizer, like this:
colcon build --packages-up-to examples_rclcpp_minimal_publisher --cmake-args -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address"
Then launch the shipped example after source installed setup.bash:
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ASAN_OPTIONS=detect_leaks=0 install/examples_rclcpp_minimal_publisher/lib/examples_rclcpp_minimal_publisher/publisher_lambda
Expected behavior
no address sanitizer problems.
Actual behavior
Then address sanitizer reports new-delete-type-mismatch, which is always related to https://github.com/ros2/rclcpp/blob/humble/rclcpp/include/rclcpp/allocator/allocator_common.hpp#L67 .
template<typename Alloc> void * retyped_allocate(size_t size, void * untyped_allocator);
template<typename T, typename Alloc> void retyped_deallocate(void * untyped_pointer, void * untyped_allocator);
Mostly retyped_allocate
is called with a size greater than 1, but later calling retyped_deallocate
will internally always use 1 as size to dealloc.
Additional information
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed