Skip to content

ASan global-overflow.cpp etc. FAIL on SPARC #108194

Open
@rorth

Description

@rorth

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions