Skip to content

Fixing asan error on mpmc queue#244

Open
MaciejKaszynski wants to merge 3 commits into
eclipse-score:mainfrom
etas-contrib:fix-asan-queue-error
Open

Fixing asan error on mpmc queue#244
MaciejKaszynski wants to merge 3 commits into
eclipse-score:mainfrom
etas-contrib:fix-asan-queue-error

Conversation

@MaciejKaszynski

@MaciejKaszynski MaciejKaszynski commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fixes the ASAN error with the MPMCConcurrentQueue

Using manual padding instead of alignas so that ASAN's fake stack can correctly.
Setting the alignment on the class itself didn't fix the asan error as it would just set the alignment for the class itself.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: db80632d-326b-4e34-99d6-df26b08cdfa6
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (30 packages loaded, 10 targets configured)

Analyzing: target //:license-check (84 packages loaded, 10 targets configured)

Analyzing: target //:license-check (139 packages loaded, 1041 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5208 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5481 targets configured)

Analyzing: target //:license-check (161 packages loaded, 8240 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 24.832s, Critical Path: 2.51s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@VukPavicRTRK VukPavicRTRK self-requested a review June 11, 2026 12:11

@VukPavicRTRK VukPavicRTRK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix for the ASan false positive. One thing to call out: CacheLinePaddedAtomic<T> preserves cache-line size but not cache-line alignment, so it weakens the original false-sharing guarantee provided by alignas(CacheLineSize). At minimum, the comments on m_head, m_tail, and m_stopped should be updated since they're no longer strictly "aligned on their own cache line."

@MaciejKaszynski

Copy link
Copy Markdown
Contributor Author

Nice fix for the ASan false positive. One thing to call out: CacheLinePaddedAtomic<T> preserves cache-line size but not cache-line alignment, so it weakens the original false-sharing guarantee provided by alignas(CacheLineSize). At minimum, the comments on m_head, m_tail, and m_stopped should be updated since they're no longer strictly "aligned on their own cache line."

So I have done a benchmark and seen that false sharing doesn't actually cause any performance drawbacks. I have committed the benchmark and made the members not aligned at all .

@S-MOHAMD

Copy link
Copy Markdown
Contributor

Please lnk corresponding issue/bug.
see: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

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

5 participants