Skip to content

Add step to lower ASLR bits to 28 when running libc++ sanitizer builds. #146273

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

Closed
wants to merge 1 commit into from

Conversation

EricWF
Copy link
Member

@EricWF EricWF commented Jun 29, 2025

The libc++ sanitizer bots have been broken for a while. This appears to be related to ASLR, since it only occurs when vm.mmap_rnd_bits > 28.

This change attempts to address this issue by lowing the ASLR bits to 28 (though allegedly LLVM 21 supports ASLR up to 32 bits?).

The libc++ sanitizer bots have been broken for a while. This
appears to be related to ASLR, since it only occurs when
vm.mmap_rnd_bits > 28.

This change attempts to address this issue by lowing the ASLR bits
to 28 (though allegedly LLVM 21 supports ASLR up to 32 bits?).
@EricWF EricWF requested a review from a team June 29, 2025 16:18
@EricWF EricWF marked this pull request as ready for review June 29, 2025 16:27
@llvmbot llvmbot added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. github:workflow labels Jun 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2025

@llvm/pr-subscribers-libcxx

@llvm/pr-subscribers-github-workflow

Author: Eric (EricWF)

Changes

The libc++ sanitizer bots have been broken for a while. This appears to be related to ASLR, since it only occurs when vm.mmap_rnd_bits > 28.

This change attempts to address this issue by lowing the ASLR bits to 28 (though allegedly LLVM 21 supports ASLR up to 32 bits?).


Full diff: https://github.com/llvm/llvm-project/pull/146273.diff

1 Files Affected:

  • (modified) .github/workflows/libcxx-build-and-test.yaml (+4)
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index f0bdf6c0b5899..da8f8848c1e25 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -166,6 +166,10 @@ jobs:
     container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
     steps:
       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+
+      - name: Reduce ASLR for Sanitizers
+        if: ${{ matrix.config == 'generic-tsan' || matrix.config  == 'generic-msan' }}
+        run: sudo sysctl vm.mmap_rnd_bits=28; sudo sysctl vm.mmap_rnd_bits;
       - name: ${{ matrix.config }}
         run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
         env:

@EricWF
Copy link
Member Author

EricWF commented Jun 29, 2025

OK, so this doesn't work.

It turns out that half of the clusters are running on ubuntu-22.04, and the other ones are on ubuntu-24, the latter have 32 bits of randomization, the former 28.

I don't believe I can downgrade the clusters on Ubuntu 24, and the clusters still on version 22 will likely be auto-upgraded soon, so that's unfortunate.

I've tried setting the sysctl settings on the cluster using the instructions here, but they don't work.

@EricWF EricWF closed this Jun 30, 2025
@EricWF
Copy link
Member Author

EricWF commented Jun 30, 2025

The fix ended up being making the changes on the node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github:workflow libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants