Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Smith via Gdb <gdb@sourceware.org>
To: "Arsen Arsenović" <arsen@aarsen.me>
Cc: gdb@sourceware.org
Subject: Re: Does gdb debuginfod download libc etc.?
Date: Sun, 08 Mar 2026 17:04:01 -0400	[thread overview]
Message-ID: <4844fe241f5524951dc68a6ce05e450897342034.camel@gnu.org> (raw)
In-Reply-To: <86wlzmfyep.fsf@aarsen.me>

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?

  reply	other threads:[~2026-03-08 21:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-07 23:58 Paul Smith via Gdb
2026-03-08  9:44 ` Arsen Arsenović via Gdb
2026-03-08 21:04   ` Paul Smith via Gdb [this message]
2026-03-09  2:32     ` Simon Marchi via Gdb
2026-03-09 13:57       ` Paul Smith via Gdb
2026-03-09 15:36         ` Simon Marchi via Gdb
2026-03-09 17:28           ` Andrew Burgess via Gdb
2026-03-09 16:57         ` Andrew Burgess via Gdb
2026-03-09 20:32           ` Paul Smith via Gdb
2026-03-09 21:19             ` Paul Smith via Gdb
2026-03-10  9:12               ` Mark Wielaard
2026-03-10 14:20               ` Andrew Burgess via Gdb
2026-03-10 17:12                 ` Paul Smith via Gdb
2026-03-11  9:28                   ` Andrew Burgess via Gdb
2026-03-11 14:46                     ` Paul Smith via Gdb
2026-03-12 20:38                     ` Paul Smith via Gdb
2026-03-13 13:45                       ` Andrew Burgess via Gdb
2026-03-13 15:44                         ` Paul Smith via Gdb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4844fe241f5524951dc68a6ce05e450897342034.camel@gnu.org \
    --to=gdb@sourceware.org \
    --cc=arsen@aarsen.me \
    --cc=psmith@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox