On PowerPC64 Linux the stack-overflow.cc test fails intermittently with:
27505==AddressSanitizer CHECK failed: /home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:94 "(((uptr)&rl >= start && (uptr)&rl < end)) != (0)" (0x0, 0x0)
I have managed to catch this failure in the debugger, but only
occasionally, and so far only with ASAN_OPTIONS=use_sigaltstack=1
and unlimited stacks ("ulimit -s unlimited").
The problem occurs when GetThreadStackTopAndBottom tries to look up the
address of a local variable in /proc/maps. On Linux, the entry for the
stack in /proc/maps deliberately excludes the first page (the
"stack guard page"):
But sometimes when we get to GetThreadStackTopAndBottom, we are already
in the guard page, so the test "(uptr)&rl >= start" fails. The fix is to
tweak the start address before this test, to try to undo the adjustment
that was done in /proc/maps.