Skip to content

Disable ASLR for unit tests#1996

Open
NickeZ wants to merge 1 commit into
BitBoxSwiss:masterfrom
NickeZ:nickez/fix-unit-test-aslr
Open

Disable ASLR for unit tests#1996
NickeZ wants to merge 1 commit into
BitBoxSwiss:masterfrom
NickeZ:nickez/fix-unit-test-aslr

Conversation

@NickeZ

@NickeZ NickeZ commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

The issue is the ASan runtime interacting badly with high-entropy ASLR / vm.mmap_rnd_bits. ASan reserves large fixed virtual address ranges for shadow memory and allocator metadata. With enough mmap
randomization, a trivial sanitized binary can start in an address range ASan cannot handle, crash during ASan startup, then recurse through ASan’s signal handler and print AddressSanitizer:DEADLYSIGNAL
indefinitely.

Relevant reports:

Local confirmation: a tiny ASan hello-world also loops here, but succeeds under:

setarch "$(uname -m)" -R /tmp/asan-simple

So I changed Makefile so make run-unit-tests runs CTest under setarch -R when available, disabling ASLR only for that test process tree.

@NickeZ NickeZ requested a review from cedwies June 22, 2026 12:41
Run the build-tree CTest invocation through setarch -R when it is
available. This keeps the existing behavior as a fallback on systems
without setarch.
@NickeZ NickeZ force-pushed the nickez/fix-unit-test-aslr branch from 8d7575a to a8b013c Compare June 22, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant