From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 431713815FF6; Wed, 5 Jun 2024 09:54:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 431713815FF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1717581263; bh=NPp9Mgy3Mg7vIUOz++9SvfVoTZn8O+vP7Qpncnpmp1A=; h=From:To:Subject:Date:From; b=PTM7wHpRDLa9ZN72LkkcwVrOL4Iuo4+ZSQcREBb1Wzl6wfIz3ZDu6OipmJBowWLfG UWHwbGtotTSEu1WGKcyInMMOs+9/A4psNWASmBuO9W2e4zWgL0o76KeTKj06L9QUam dyd2d3ypnEzYA0gdkHA3Ur6XdmrN+1EN3Fkx0MAQ= From: "antoine.allard at outlook dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/31846] New: GDB fails to read build ID from debug file Date: Wed, 05 Jun 2024 09:54:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: antoine.allard at outlook dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31846 Bug ID: 31846 Summary: GDB fails to read build ID from debug file Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: antoine.allard at outlook dot com Target Milestone: --- I have reproduced this issue with both GDB 14.2 and HEAD. I have a separate debug file _debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debug_ that GDB = is resolving but skips with the following warning: ``` (gdb) symbol-file XXX Reading symbols from XXX... warning: File "debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.de= bug" has no build-id, file skipped ``` However, other tools can read the build ID embedded in this debug file: ```=20 $ file --version file-5.33 $ file debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debug debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debug: ELF 64-bit= LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter *empty*, for GNU/Linux 3.2.0, BuildID[sha1]=3Dd893a4204e84a2777fd175096616364bcdfb6714, with debug_info, = not stripped $ readelf --version GNU readelf version 2.30-119.el8 $ readelf -n debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debu= g | grep "Build ID:" Build ID: d893a4204e84a2777fd175096616364bcdfb6714 ``` I have another binary from the same build that GDB has no issue with: ``` (gdb) symbol-file YYY Reading symbols from YYY... Reading symbols from debug/.build-id/dc/48b56fec6a71a384f0b78dfa0431f25d6fb62f.debug... ``` The only difference as far as I can tell is in the size of the debug files: ``` # XXX skipped debug file $ du -skh debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debug 5.6G debug/.build-id/d8/93a4204e84a2777fd175096616364bcdfb6714.debug # YYY loaded debug file $ du -skh debug/.build-id/dc/48b56fec6a71a384f0b78dfa0431f25d6fb62f.debug 19M debug/.build-id/dc/48b56fec6a71a384f0b78dfa0431f25d6fb62f.debug ``` I tried to debug GDB itself and I was able to pinpoint to difference between XXX and YYY to the calls to `bfd_check_format()` in `build_id_bfd_get()` [gdb/build-id.c:33](https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dbl= ob;f=3Dgdb/build-id.c;h=3D41667d5e5cf3dd9fb3a9f778fb56d21a2e3485c0;hb=3DHEA= D#l41). Both call `bfd_check_format()` return false in the case of the XXX debug fi= le, but I am not able to understand why. --=20 You are receiving this mail because: You are on the CC list for the bug.=