Skip to content
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

Enable Ubuntu sanitizers on CI builds #9

Open
1 task done
bitwizeshift opened this issue Jan 5, 2021 · 0 comments
Open
1 task done

Enable Ubuntu sanitizers on CI builds #9

bitwizeshift opened this issue Jan 5, 2021 · 0 comments
Labels
Complexity: Medium This might take a few days of work Priority: High High-priority Status: Available This task is available to be looked at Type: Bug Report For bugs that need to be fixed (For "Issues" only) Type: Enhancement For enhancements on existing functionality

Comments

@bitwizeshift
Copy link
Owner

Checklist

  • I did not find a duplicate of this feature request in the Github Issues section.

Description

This feature is to enable sanitizers on the Ubuntu build, which requires some code-changes to fix.

The current infrastructure is in-place, but failing to run correctly due to new and delete usages in
the standard-library. It is detecting ::operator new (std::size_t, std::align_t) from alloy::core::allocator
as not being the same alignment used in ::operator delete(std::size_t, std::align_t):

  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.

Marking this as both an enhancement and bug report, since there is likely a fix required here.

@bitwizeshift bitwizeshift added Status: Available This task is available to be looked at Type: Bug Report For bugs that need to be fixed (For "Issues" only) Type: Enhancement For enhancements on existing functionality Priority: High High-priority Complexity: Medium This might take a few days of work labels Jan 5, 2021
bitwizeshift added a commit that referenced this issue Jan 5, 2021
This fixes the broken Github Actions workflows, which were previously
broken by Github's removal of support for their `::set-env`
commands.

Several bugs have been discovered through this process, and several
builds are currently on-hold pending investigation. New issues have
been opened up in the Github repository to track these problems, they
are #8 and #9 respectively.

As an added benefit, the CI for this project has also been updated now
to additionally include _some_ support for sanitizers -- though these
sanitizers are not run on Ubuntu yet (pending resolution of #9).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium This might take a few days of work Priority: High High-priority Status: Available This task is available to be looked at Type: Bug Report For bugs that need to be fixed (For "Issues" only) Type: Enhancement For enhancements on existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant