Why ASan crashes one run in four in Docker on Ubuntu AddressSanitizer fails in roughly one in four runs inside Docker on Ubuntu because Ubuntu kernels ship with CONFIG_ARCH_MMAP_RND_BITS=32, the maximum, versus the upstream default and kernel minimum of 28, according to an analysis by Joshua Rogers published on joshua.hu. Testing 100 runs per image, Rogers found gcc 12.2.0 on debian:bookworm reported 69 times and hung 31 times with repeated AddressSanitizer:DEADLYSIGNAL, clang 14.0.6 on debian:bookworm reported 76 times and died with a plain Segmentation fault 24 times, and clang 14.0.0 on ubuntu:22.04 reported 84 times with 16 segmentation faults, while gcc on ubuntu:22.04, ubuntu:24.04 and debian:trixie reported 100 of 100. Rogers traced the failures to older ASan runtimes placing their heap at the hardcoded 4TiB region starting at 0x600000000000 (kAllocatorSpace in compiler-rt): every run where the binary loaded between 0x600000000000 and 0x640000000000 failed, and setting vm.mmap_rnd_bits=28 on the host fixes it. In my post about sanitizers as an oracle https://joshua.hu/lessons-using-sanitizers-oracle-llm-vulnerability-triage b2-asan-in-docker , I noted that ASan inside Docker on Ubuntu hangs or crashes “about one run in four”, and that the fix is vm.mmap rnd bits=28 on the host. I also said that Ubuntu “randomize s more of the address space than ASan’s shadow memory can live with”. That last part turns out to be wrong, and I wanted to look more into why this happened, and why only one in four times. Let’s take a one-byte oob vulnerable code: include