[compiler-rt] [ASan][test] Fix TestCases/Posix/stack-overflow.cpp on Solaris/sparcv9 (PR #109101)
Rainer Orth via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 02:10:27 PDT 2024
rorth wrote:
@ebotcazou
I've spent quite some time to make this work on Linux/sparc64, too, but ultimately failed for a couple of reasons:
- The `lduwa`/`ldxa` insns require a SPARC V9 CPU. This is the only one Solaris runs on, so no issue there, while Linux is different: there are distros supporting V8 (e.g. LEON Linux), so this would need something like [[Driver][Sparc] Default to -mcpu=v9 for SparcV8 on Linux](https://reviews.llvm.org/D130688) which got stalled 2 years ago. I've got an updated version ready, but am uncertain there's a chance of getting this in.
- Besides, I got all sorts of weird fault addresses `SignalContext::IsStackOverflow` returns `false` for (sometimes 0x0, sometimes addresses on the first page), so it didn't seem possible to reliably detect a stack overflow. I have no idea if that's related to the kernel passing a `sigcontext *` as third arg to signal handles on 32-bit Linux/sparc64 (and apparently the usual `ucontext_t *` for 64-bit, which has more info and could use the `ucontext.ss_sp` element to get at the stack limit).
This got all so weird and frustrating that I decided to leave this to someone with more Linux knowledge in order not to stall the Solaris fix any longer.
https://github.com/llvm/llvm-project/pull/109101
More information about the llvm-commits
mailing list