<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/109771>109771</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Posix/stack-overflow.cpp etc. FAIL on Linux/sparc64
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            compiler-rt:asan,
            platform:linux,
            compiler-rt:sanitizer
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rorth
      </td>
    </tr>
</table>

<pre>
    With ASan SPARC testing enabled as per PR #107405, several stack overflow tests `FAIL` on Linux/sparc64:
```
  AddressSanitizer-sparc-linux :: TestCases/Linux/stack-overflow-recovery-mode.cpp
 AddressSanitizer-sparc-linux :: TestCases/Linux/stack-overflow-sigbus.cpp
 AddressSanitizer-sparc-linux :: TestCases/Posix/stack-overflow.cpp
 AddressSanitizer-sparc-linux-dynamic :: TestCases/Linux/stack-overflow-recovery-mode.cpp
 AddressSanitizer-sparc-linux-dynamic :: TestCases/Linux/stack-overflow-sigbus.cpp
 AddressSanitizer-sparc-linux-dynamic :: TestCases/Posix/stack-overflow.cpp
```
Even applying a slightly modified version of PR #109101, the failures aren't fixed.  Looking closer, the weird thing is that the faulting address is reported at the very top (or bottom) of the address space, outside of the stack allocation that can be seen with `pmap -x`.

E.g. for `Posix/stack-overflow.cpp`, I see
```
ERROR: AddressSanitizer: SEGV on unknown address 0xfffffff4 (pc 0x70125064 bp 0x00000000 sp 0xff50bf40 T0)
```
thus this is not treated as a stack overflow.  This matches that strace reports:
```
2447748 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfffffff4} ---
```
I don't really know what to make of this.  @glaubitz 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU1v4zgM_TXKhbAhy1_xwQdP2wwKdLFFWsweC9qmY21ly5DkNJlfv5DjdrDdzuy3kSCxKD6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