This feature is to enable sanitizers on the Ubuntu build, which requires some code-changes to fix.
object passed to delete has wrong type:
alignment of the allocated type: default-aligned;
alignment of the deallocated type: 16 bytes.
#0 0x4e6062 in operator delete(void*, std::align_val_t) (/home/runner/work/Alloy/Alloy/build/lib/alloy-core/test/alloy-core-test+0x4e6062)
#1 0x53cfee in alloy::core::allocator::default_resource::do_deallocate(void*, unsigned long, std::align_val_t) /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/memory/allocator.hpp:990:3
#2 0x5fa98c in alloy::core::memory_resource::deallocate(void*, unsigned long, std::align_val_t) /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/memory/memory_resource.hpp:268:10
#3 0x5fa4c4 in alloy::core::allocator::deallocate_bytes(void*, unsigned long, std::align_val_t) /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/memory/allocator.hpp:532:22
#4 0x5fa460 in alloy::core::stl_allocator_adapter<std::byte>::deallocate(std::byte*, unsigned long) /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/memory/allocator.hpp:1045:22
#5 0x5fa424 in std::allocator_traits<alloy::core::stl_allocator_adapter<std::byte> >::deallocate(alloy::core::stl_allocator_adapter<std::byte>&, std::byte*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:341:13
#6 0x5fa3ea in std::_Vector_base<std::byte, alloy::core::stl_allocator_adapter<std::byte> >::_M_deallocate(std::byte*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:354:4
#7 0x5fa2fe in std::_Vector_base<std::byte, alloy::core::stl_allocator_adapter<std::byte> >::~_Vector_base() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:335:2
#8 0x5fa181 in std::vector<std::byte, alloy::core::stl_allocator_adapter<std::byte> >::~vector() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:683:7
#9 0x5fa0c7 in alloy::core::explicitly_copyable<std::vector<std::byte, alloy::core::stl_allocator_adapter<std::byte> > >::~explicitly_copyable() /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/utilities/explicitly_copyable.hpp:59:9
#10 0x5f9334 in alloy::core::packed_buffer::~packed_buffer() /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/include/alloy/core/memory/packed_buffer.hpp:61:24
#11 0x5ea00f in alloy::core::test::(anonymous namespace)::____C_A_T_C_H____T_E_S_T____3() /home/runner/work/Alloy/Alloy/build/../lib/alloy-core/test/src/alloy/core/memory/packed_buffer.test.cpp:52:1
It's not entirely clear what could be causing this discrepancy. This fails with both clang and gcc on Ubuntu, but does not appear to occur on mac -- suggesting that this may either be a variation between libc++
and libstdc++
, or potentially that this is undefined behavior that is detected in different versions of the compiler.
At any rate, this issue needs to be investigated and fixed before sanitizers can be enabled.