llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.98k stars 11.95k forks source link

llvm-gsymutil: Symbol lost after DWARF -> GSYM conversion #115515

Open javierhonduco opened 2 hours ago

javierhonduco commented 2 hours ago

The issue

An address that symbolizes without issues on DWARF with GNU's addr2line does not yield any result on the converted GSYM file. Happy to help with anything, let me know!

Repro

Fetch the DWARF debug info

Which belongs to a Fedora kernel

$ wget https://debuginfod.fedoraproject.org/buildid/b8d70cf519fac5a5cccdda1a61c38995bd9b3059/debuginfo

addr2line on the DWARF file works without issues

$ addr2line -fe debuginfo 0xffffffff8220012f
entry_SYSCALL_64_after_hwframe
/usr/src/debug/kernel-6.9.11/linux-6.9.11-200.fc40.x86_64/arch/x86/entry/entry_64.S:130

After converting it

$ llvm-gsymutil --convert=debuginfo --out-file=debuginfo.gsym

llvm-gsymutil fails to find the symbol for that same address

$ llvm-gsymutil --address=0xffffffff8220012f debuginfo.gsym
Looking up addresses in "/tmp/nix-shell.K7SvqT/.tmpcNXLtG":
0xffffffff8220012f: error: address 0xffffffff8220012f is not in GSYM

Environmental information

$ llvm-gsymutil --version
llvm-gsymutil
LLVM (http://llvm.org/):
  LLVM version 18.1.6
  Optimized build.

But this also fails on a recent commit:

$ git show
commit 9f8c3d3796ebf7ddd4a85134ff109cf03a0b9b5e (grafted, HEAD -> main, origin/main, origin/HEAD)
Author: David Spickett <david.spickett@linaro.org>
Date:   Wed Nov 6 10:42:11 2024 +0000

    [lldb][test] Correct typo in breakpoint test file name

    Added by https://github.com/llvm/llvm-project/pull/114896.
/home/javierhonduco/src/llvm-project/build/bin/llvm-gsymutil
LLVM (http://llvm.org/):
  LLVM version 20.0.0git
  Optimized build.

The conversion output: https://gist.github.com/javierhonduco/7d32feaff1b0d04365c6deb1c3a53b8c

Thanks!

javierhonduco commented 2 hours ago

cc/ @clayborg @kevinfrei. Let me know if there's anything I can do to help debug this!

kevinfrei commented 2 hours ago

I'm headed to an airport in about 5 minutes. When I'm through security, I'll see if I can repro it.