Open llvmbot opened 4 years ago
I've taken a quick look at the code, and it looks as if here:
Optional
the DW_FORM_GNU_ref_alt case should return DWARFUnit, which refers to (a portion of) a file referenced by .gnu_debugaltlink, but instead it returns just nullptr.
I just checked, and the problem also exists on x86_64 F31:
$ readelf --debug-dump=info /usr/lib/debug/lib64/libpython3.7m.so.1.0-3.7.9-1.fc31.x86_64.debug
<1><9a93>: Abbrev Number: 45 (DW_TAG_subprogram) <9a94> DW_AT_abstract_origin:Hmm, actually the support is there since r237721. But it seems to be broken at least on s390x. I'll change the bug title to reflect this.
Extended Description
I noticed that llvm-symbolizer fails to fully symbolize python3-related backtraces on s390x Fedora 31. I tracked this down to lack of .gnu_debugaltlink support, so I'm fairly confident the problem occurs on other architectures as well.
For example:
$ llvm-project/build/bin/llvm-symbolizer -e /usr/lib64/libpython3.7m.so.1.0 0x3fffcf998c3 --adjust-vma 0x3fffcf00000 ?? /usr/src/debug/python3-3.7.4-5.fc31.s390x/Objects/obmalloc.c:1585:11 ?? /usr/src/debug/python3-3.7.4-5.fc31.s390x/Objects/obmalloc.c:1577:1
Surprisingly, llvm-symbolizer shows the correct source code lines, but no function names.
If we extract relevant DIE offsets with the debugger and dig into libpython3 debuginfo, we'll see:
<1><25eac>: Abbrev Number: 40 (DW_TAG_subprogram) <25ead> DW_AT_abstract_origin: