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

    <tr>
        <th>Summary</th>
        <td>
            ASan global-overflow.cpp etc. FAIL on SPARC
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    When enabling ASan on SPARC with PR #107405, two tests `FAIL` in similar ways:
```
  AddressSanitizer-sparc-sunos :: TestCases/global-overflow.cpp
  AddressSanitizer-sparc-sunos :: TestCases/large_func_test.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/global-overflow.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/large_func_test.cpp
```
For both tests, at `-O1` and above one line number in the stacktrace is missing:
```
    #0 0x00100f1c in main compiler-rt/test/asan/TestCases/global-overflow.cpp
```
It turns out this happens because `.debug_line`, which `llvm-symbolizer` uses to map the address to source file and line, is wrong, as seen with `llvm-dwarfdump --debug-line`:
```
0x0000000000100f1c      0      0      0   0 0       0 
```
while at `-O0` things are fine:
```
    #0 0x00100ed8 in main compiler-rt/test/asan/TestCases/global-overflow.cpp:14:13

0x0000000000100ed8 14     13      0   0             0       0  is_stmt
```
`g++` gets this right OTOH: the test works irrespective of optimization.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVF-L2zgQ_zTKy-AgyYm9efBDmhKucLClW7jHRbbHtq6yZDRyfNtPf4w3uZbe7rEcK4yFJDTz-zMaQ2R7j1iJ_Qex_7gxcxpCrGKIadjUoX2q_hjQA3pTO-t7OD4YD8HDw-fjlxMsNg3w-QsInStZ7uRe6BOkJUBCSgSikOfjp99FIcF6IDtaZyIs5olEfhTyo5BHUcjrty4Bjm0bkejBeJvsd4wZTSY2Gc0-EPC1_AhfkdLJEJLQ596F2rgsXDB2LizbZpr-byhnYo-P3eybR8b_1lBZ--TNaJt3RPdfIV9F-YuU5xChDml49oKNMYkdye4VG2J8C6YOF4TgEZz1CH4ea4xsVRoQKJnmW4qmQbAEoyWyvn_dN-AikCD_klJJ2amG44zGemjCOFmHMYtJ6DOjEfpsyHihz2_S6pdcnxKkOXqCMCdIgyUYzDShJ6ixMTMhs9y2WM_9I_Pii_oEy2CbgY-cu4wZPY11cKw7izETEqQAo5lW7ubZG96iMMcGobMOV83WiPrEmiwx-H4VloAQ_fNzuGVoFxO7dh4nyLIVTHYD84qGLN1tXCVch_zXJG8LkPBiqGVY4V795n0WyvcEJjIXj281Etu7dzEyP6od__Jr1pcYcy61W3mp_Ge2P48fzMHSI6UxvchDFLIX-gN_hYQeEz2XSrT9kOD-6_1v_K7Ya-YBS4jfCGyMSBM2yfKz6CBMyY72u0k2-O2mrfL2kB_MBitV6kLu9_pQbIZK6bbRMt-rsiy17rAwnS5lnqMs0OQKN7bSUu_kQSmldneq2Jblvqzzclfu607WpRY7iaOxbsuFsw2x31iiGSsl79Rht3GmRkdrh9ba4wLrqdCaG3as1mqr557ETjpLiX6ESTY5rNae_YIpgKnZAnfofzr6Zo6uGlKa1g6tz-ymTcNcb5swcvNxl9uUTTH8iQ3XwIqHnb8CvlT67wAAAP__6f7vWg">