1

I need the debug symbols for libc on Ubuntu 20.04 for performance profiling in gperftools (or perf). I checked how to install them and used:

sudo apt-get install libc6-dbg

After successfull Installation I don't find any libc related files in /usr/lib/debug. What could be the issue?

purge and repeated install did not help.

The version of libc shown matches my system version 2.31-0ubuntu9.15.

I found this thread which seems related How to Install Debug Symbols for libc on Ubuntu 22.04?. The only answer points to this forum entry https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1918035.

When I search for the debug info that way I get an entry in a hidden folder. However I'm not sure what to do with it:

$ dpkg -L libc6-dbg | grep $(readelf -n /lib/x86_64-linux-gnu/ld-2.31.so | grep 'Build ID' | awk '{print $3}' | cut -c 3-)
/usr/lib/debug/.build-id/c9/a47e328eb2f1f41bcbcf31f9c11b9e17aa2a83.debug
12
  • Are you sure ? I get a error (can not found package) when I run sudo apt-get install libc6-dbg on Ubuntu 20.04. Commented May 24, 2024 at 10:27
  • "Unsure what to do with it" - usually, you need not do anything. Your debugger should find it just fine where it is. Commented May 24, 2024 at 10:31
  • @life888888 Yes, I get "libc6-dbg is already the newest version (2.31-0ubuntu9.15)." when retrying. Commented May 24, 2024 at 10:37
  • 1
    And you're sure that it's the debug symbols for ld-2.31.so that you want, and not the ones for libc.so.6? Commented May 24, 2024 at 12:11
  • 1
    Couple things. First, gperftools ships really old and deprecated pprof implementation (see e.g. bugs.debian.org/cgi-bin/bugreport.cgi?bug=1049383). You should (manually for now) get go implementation from github.com/google/pprof. Second, PPROF_BINARY_PATH is path to pprof program. And it invokes addr2line and similar tools. It is up to them to handle debug info. Commented May 27, 2024 at 12:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.