FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-158868: Reduce ASLR in the MSan CI job by StanFromIreland · Pull Request #158872 · python/cpython · GitHub

Repository navigation

gh-158868: Reduce ASLR in the MSan CI job - #158872

Merged
vstinner merged 1 commit into
python:mainfrom
StanFromIreland:msan-aslr
Oct 5, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
StanFromIreland:msan-aslr

Conversation

Copy link
Copy Markdown
Member

This fixes the bug reported in #158868, rather than skipping the job.

To reproduce this locally:

$ sudo sysctl vm.mmap_rnd_bits
vm.mmap_rnd_bits = 28
$ for i in $(seq 300); do
  MSAN_OPTIONS=verbosity=1 ./python -m test test_os.test_posix -m test_fexecve 2>&1 \
    | grep -E 'execve failed|incompatible' && { echo "failed on run $i"; break; }
done
$ sudo sysctl -w vm.mmap_rnd_bits=32
vm.mmap_rnd_bits = 32
$ for i in $(seq 300); do   MSAN_OPTIONS=verbosity=1 ./python -m test test_os.test_posix -m test_fexecve 2>&1     | grep -E 'execve failed|incompatible' && { echo "$i"; break; }; done
==35706==WARNING: MemorySanitizer: memory layout is incompatible, possibly due to high-entropy ASLR.
execve failed, errno 2
4

We actually already do this for the TSan job, it seems we got unlucky on the PR that added MSan:

sudo sysctl -w vm.mmap_rnd_bits=28 # Reduce ASLR to avoid TSan crashing

In the test, the mappings of the exec'd child sometimes land where MSan needs its shadow memory, so the MSan runtime disables ASLR and re-executes the process at startup, which fails because the child was started from a close-on-exec file descriptor.

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. It seems correct to reuse the same configuration than then TSan job.

vstinner enabled auto-merge (squash) October 5, 2026 19:08
vstinner disabled auto-merge October 5, 2026 19:09
vstinner merged commit dc0add3 into python:main Oct 5, 2026
59 checks passed
StanFromIreland deleted the msan-aslr branch October 5, 2026 19:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL