[llvm-bugs] [Bug 47537] New: llvm-symbolizer does not support .gnu_debugaltlink

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 15 12:24:54 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47537

            Bug ID: 47537
           Summary: llvm-symbolizer does not support .gnu_debugaltlink
           Product: libraries
           Version: trunk
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: iii at linux.ibm.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

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: <alt 0x10f7a>
    <25eb1>   DW_AT_low_pc      : 0x99850
    <25eb9>   DW_AT_high_pc     : 148
    <25ebb>   DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <25ebd>   DW_AT_GNU_all_call_sites: 1
    <25ebd>   DW_AT_sibling     : <0x25f58>

DW_AT_abstract_origin points to <alt 0x10f7a>, so the target DIE is in a file
pointed to by .gnu_debugaltlink. As far as I understand, dwz produces these
when deduplicating debuginfo.

And indeed:

Contents of section .gnu_debugaltlink:
 0000 2e2e2f2e 2e2f2e64 777a2f70 7974686f  ../../.dwz/pytho
 0010 6e332d33 2e372e34 2d352e66 6333312e  n3-3.7.4-5.fc31.
 0020 73333930 7800467e 07ea9a25 a5feb0ca  s390x.F~...%....
 0030 82f3ed5f 3ebb73aa 698e               ..._>.s.i.      

If we look into
/usr/lib/debug/usr/lib64/libpython3.7m.so.1.0-3.7.4-5.fc31.s390x.debug, we'll
find:

 <1><10f7a>: Abbrev Number: 26 (DW_TAG_subprogram)
    <10f7b>   DW_AT_name        : (indirect string, offset: 0x19edc):
_PyObject_Malloc
    <10f7f>   DW_AT_decl_file   : 200
    <10f80>   DW_AT_decl_line   : 1577
    <10f82>   DW_AT_decl_column : 1
    <10f83>   DW_AT_prototyped  : 1
    <10f83>   DW_AT_type        : <0x52df7>
    <10f87>   DW_AT_sibling     : <0x10fb1>

_PyObject_Malloc is exactly the missing function name.

It would be great if .gnu_debugaltlink support could be added to
llvm-symbolizer. I see that lldb already has it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200915/a28c02a7/attachment.html>


More information about the llvm-bugs mailing list