Description
MPMCConcurrentQueue has alignas(64) members (m_head, m_tail, m_stopped). ASan's fake stack does not honor over-alignment, so when a test fixture embeds the queue as a value member, UBSan reports a misaligned reference at constructor entry (mpmc_concurrent_queue.hpp:87) before any queue logic executes. The test is otherwise clean.
Currently worked around with:
in concurrency/BUILD.
Analysis results
No response
Solution
Three options:
- Add
alignas(CacheLineSize) to the class itself - declares the alignment requirement as part of the type.
- Add a UBSan alignment suppression in
score_cpp_policies for score::lcm::internal::MPMCConcurrentQueue.
- Heap-allocate the queue in test fixtures (
std::make_unique<...>()).
Error Occurrence Rate
Reproducible
How to reproduce
Remove no-asan from the target, then run:
bazel test --config=asan_ubsan_lsan --config=x86_64-linux \
//score/launch_manager/daemon/src/common/concurrency:mpmc_concurrent_queue_test \
--test_tag_filters= \
--verbose_failures
Supporting Information
No response
Classification
Minor
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category
Description
MPMCConcurrentQueuehasalignas(64)members (m_head,m_tail,m_stopped). ASan's fake stack does not honor over-alignment, so when a test fixture embeds the queue as a value member, UBSan reports a misaligned reference at constructor entry (mpmc_concurrent_queue.hpp:87) before any queue logic executes. The test is otherwise clean.Currently worked around with:
in
concurrency/BUILD.Analysis results
No response
Solution
Three options:
alignas(CacheLineSize)to the class itself - declares the alignment requirement as part of the type.score_cpp_policiesforscore::lcm::internal::MPMCConcurrentQueue.std::make_unique<...>()).Error Occurrence Rate
Reproducible
How to reproduce
Remove
no-asanfrom the target, then run:bazel test --config=asan_ubsan_lsan --config=x86_64-linux \ //score/launch_manager/daemon/src/common/concurrency:mpmc_concurrent_queue_test \ --test_tag_filters= \ --verbose_failuresSupporting Information
No response
Classification
Minor
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category