Re: Does gdb debuginfod download libc etc.?

Paul Smith via Gdb
2026-03-08T21:04:53Z

On Sun, 2026-03-08 at 10:44 +0100, Arsen Arsenović wrote:
> This is strange - I've tried replicating it.

Thanks for making that effort!

> For context, I run a debuginfod instance populated with packages I
> build for my own Gentoo binhost.  To test this, I got a dump from a
> few days ago, and put it in a blank Arch Linux container (meaning it
> had access to none of my installed libraries) with gdb 17.1, and told
> it to look up debug info on my debuginfod server.  It pulled all the
> libraries

That definitely looks like what I had hoped to see. However it doesn't
work for me. FWIW I forgot to mention I'm using GDB 17.1 that I built
myself using latest elfutils with all the stuff in it that is needed
(json-c, curl, xz/zstd, etc.) (I hope!!)

I'm confident that all the binaries etc. have build IDs: if I run
"eu-unstrip -n --core core" then not only do I see all the build IDs,
but eu-unstrip actually downloads everything correctly from the
debuginfod server! Before I run it my cache is empty, afterwards it
has all the things in it.

But, they are still not loaded by GDB (I guess that makes sense--if it
were trying to load them and failing I'd see messages).

> You can probably try debugging this by setting:
>
>   set debug separate-debug-file on
>
> ... or such, to see whether gdb knows about the build IDs.

I tried enabling this but didn't learn much. I don't use any separate
debug info: all my libraries have the debuginfo in the file itself. I
did discover that setting DEBUGINFOD_VERBOSE before starting GDB will
show internal debug info from the debuginfod library so I ran this:

DEBUGINFOD_VERBOSE=9 gdb -c core

Here's the output I get:

---------------
[separate-debug-file] build_id_to_bfd_suffix: enter
[separate-debug-file] build_id_to_debug_bfd_1: Trying
/lib/debug/.build-id/f8/7c1d8cd2118209ef2350b22b187a64d705d6cd...
[separate-debug-file] build_id_to_debug_bfd_1: path doesn't exist
[separate-debug-file] build_id_to_debug_bfd_1: no suitable file found
[separate-debug-file] build_id_to_bfd_suffix: exit
debuginfod_find_executable f87c1d8cd2118209ef2350b22b187a64d705d6cd
server urls "http://debuginfod:8002"
checking build-id
checking cache dir /home/pds/.cache/debuginfod_client
found
/home/pds/.cache/debuginfod_client/f87c1d8cd2118209ef2350b22b187a64d705
d6cd/hdr-executable (bytes=55)
found
/home/pds/.cache/debuginfod_client/f87c1d8cd2118209ef2350b22b187a64d705
d6cd/executable (fd=14)
Reading symbols from
/home/pds/.cache/debuginfod_client/f87c1d8cd2118209ef2350b22b187a64d705
d6cd/executable...

⚠️ warning: platform-specific solib_create_inferior_hook did not load
initial shared libraries.

⚠️ warning: .dynamic section for "/lib64/ld-linux-x86-64.so.2" is not
at the expected address (wrong library or version mismatch?)

⚠️ warning: Could not load shared library symbols for 9 libraries, e.g.
/opt/lib64/libicui18n.so.75.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Reading symbols from /lib64/ld-linux-x86-64.so.2...
[separate-debug-file] find_separate_debug_file_by_buildid: start:
looking for separate debug info (build-id) for /lib64/ld-linux-x86-
64.so.2
[separate-debug-file] build_id_to_bfd_suffix: enter
[separate-debug-file] build_id_to_debug_bfd_1: Trying
/lib/debug/.build-id/8c/fa19934886748ff4603da8aa8fdb0c2402b8cf.debug...
[separate-debug-file] build_id_to_debug_bfd_1: path doesn't exist
[separate-debug-file] build_id_to_debug_bfd_1: no suitable file
found
[separate-debug-file] build_id_to_bfd_suffix: exit
[separate-debug-file] find_separate_debug_file_by_buildid: end: looking
for separate debug info (build-id) for /lib64/ld-linux-x86-64.so.2
debuginfod_find_debuginfo 8cfa19934886748ff4603da8aa8fdb0c2402b8cf
server urls "http://debuginfod:8002"
checking build-id
checking cache dir /home/pds/.cache/debuginfod_client
not found No such file or directory (err=-2)
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
Reading symbols from system-supplied DSO at 0x7ffff85e4000...
[separate-debug-file] find_separate_debug_file_by_buildid: start:
looking for separate debug info (build-id) for system-supplied DSO at
0x7ffff85e4000
[separate-debug-file] build_id_to_bfd_suffix: enter
[separate-debug-file] build_id_to_debug_bfd_1: Trying
/lib/debug/.build-id/bf/619d454c75501884ae152c241f1f2c2039f532.debug...
[separate-debug-file] build_id_to_debug_bfd_1: path doesn't exist
[separate-debug-file] build_id_to_debug_bfd_1: no suitable file
found
[separate-debug-file] build_id_to_bfd_suffix: exit
[separate-debug-file] find_separate_debug_file_by_buildid: end: looking
for separate debug info (build-id) for system-supplied DSO at
0x7ffff85e4000
debuginfod_find_debuginfo bf619d454c75501884ae152c241f1f2c2039f532
server urls "http://debuginfod:8002"
checking build-id
checking cache dir /home/pds/.cache/debuginfod_client
not found No such file or directory (err=-2)
(No debugging symbols found in system-supplied DSO at 0x7ffff85e4000)
Core was generated by `/opt/bin/exe'.
#0 0x0000000001fa11ca in WriteCompressedCoreDump ()
[Current thread is 1 (LWP 2184998)]
---------------

I wonder if it has something to do with this:

> ⚠️ warning: platform-specific solib_create_inferior_hook did not load
> initial shared libraries.

But I don't know what that means or how to go further in debugging.

Based on the lack of debuginfod verbose output, GDB is not even asking
to load those libraries so it seems to be something more basic / in GDB
itself, not in the debuginfod support.

Maybe there's some autoconf switch or library that I'm missing?