Skip to content

mpmc_concurrent_queue_test excluded from ASan/UBSan due to fake-stack alignment false positive #241

@VukPavicRTRK

Description

@VukPavicRTRK

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:

tags = ["no-asan"]

in concurrency/BUILD.

Analysis results

No response

Solution

Three options:

  1. Add alignas(CacheLineSize) to the class itself - declares the alignment requirement as part of the type.
  2. Add a UBSan alignment suppression in score_cpp_policies for score::lcm::internal::MPMCConcurrentQueue.
  3. 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

  • Safety Relevant
  • Security Relevant

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions