Skip to content

test/encoding: use setarch -R for ASAN builds in readable.sh#67531

Open
tchaikov wants to merge 1 commit intoceph:mainfrom
tchaikov:wip-encoding-with-asan
Open

test/encoding: use setarch -R for ASAN builds in readable.sh#67531
tchaikov wants to merge 1 commit intoceph:mainfrom
tchaikov:wip-encoding-with-asan

Conversation

@tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Feb 25, 2026

When running readable.sh with a WITH_ASAN=ON build of ceph-dencoder, ASAN processes need to find a contiguous 16+ TB shadow memory region (1/8 of the 128 TB x86-64 user VA space). High ASLR entropy can fragment the VA space, preventing ASAN from finding a suitable region.

Instead of requiring system-wide vm.mmap_rnd_bits=28 (which weakens ASLR security for the entire host), wrap ceph-dencoder with 'setarch $(uname -m) -R' when ASAN is detected. This disables ASLR only for the specific ceph-dencoder processes, with no system-wide security impact.

Also simplify parallelism logic: extract NPROC calculation into a shared variable and use it consistently across FreeBSD, Darwin, and Linux.

Reference: https://clang.llvm.org/docs/AddressSanitizer.html

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

When running readable.sh with a WITH_ASAN=ON build of ceph-dencoder,
ASAN processes need to find a contiguous 16+ TB shadow memory region
(1/8 of the 128 TB x86-64 user VA space). High ASLR entropy can
fragment the VA space, preventing ASAN from finding a suitable region.

Instead of requiring system-wide vm.mmap_rnd_bits=28 (which weakens
ASLR security for the entire host), wrap ceph-dencoder with 'setarch
$(uname -m) -R' when ASAN is detected. This disables ASLR only for the
specific ceph-dencoder processes, with no system-wide security impact.

Also simplify parallelism logic: extract NPROC calculation into a shared
variable and use it consistently across FreeBSD, Darwin, and Linux.

Reference: https://clang.llvm.org/docs/AddressSanitizer.html

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
@github-actions github-actions bot added the tests label Feb 25, 2026
@tchaikov tchaikov mentioned this pull request Feb 25, 2026
14 tasks
@tchaikov tchaikov requested a review from a team March 19, 2026 06:17
@tchaikov
Copy link
Contributor Author

@ceph/core hello maintainers, could you help review this change?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant