From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9256C3851C2F; Tue, 22 Jun 2021 05:26:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9256C3851C2F From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/28004] New: DW_AT_ranges with form DW_FORM_sec_offset problem Date: Tue, 22 Jun 2021 05:26:23 +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: simark at simark dot ca X-Bugzilla-Status: NEW 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 05:26:23 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28004 Bug ID: 28004 Summary: DW_AT_ranges with form DW_FORM_sec_offset problem Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simark at simark dot ca Target Milestone: --- Using the repro files I will provide subsequently (it might be a bit large,= I might have to host it externally), extracted to /tmp/repro, run this a first time: $ ./gdb -nx --data-directory=3Ddata-directory -iex "set index-cache on" -ie= x "set sysroot /tmp/repro" /tmp/repro/gdb /tmp/repro/core -ex bt -batch ... warning: (Internal error: pc 0x7ff8feb2c21d in read in psymtab, but not in symtab.) ... This message is not expected and is already a symptom. Run it a second tim= e, this time the index from the index-cache gets picked up. $ ./gdb -nx --data-directory=3Ddata-directory -iex "set index-cache on" -ie= x "set sysroot /tmp/repro" /tmp/repro/gdb /tmp/repro/core -ex bt -batch ... /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:5014: internal-error: compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*, bound_minimal_symbol, CORE_ADDR, obj_section*, int): Assertion `result !=3D= NULL' failed. ... Bisects to: commit 9f6c202e573b796a9e7328cc5fdab7c0c63776bf=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Author: Tom de Vries =20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 Date: Mon Jan 25 16:32:31 2021 +0100=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 [gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE The test binary happens to be a gdb executable I was trying to debug, but it doesn't really matter. I generated a core from it to make the problem easy= to reproduce. I included only the necessary libraries from my system to allow reproducing. They are from Arch Linux x86-64 packages: - libc-2.33.so from package glibc 2.33-5 - libstdc++.so.6.0.29 from package gcc-libs 11.1.0-1 The main point is that libstdc++.so contains DWARF5 debug information, with DW_AT_ranges using DW_FORM_sec_offset form. It looks like we are processing the ranges wrong when using the psymtab reader (hence the strange warning we get the first time). And that makes us produce an invalid index in the cac= he, which, when we load the second time, confuses the GDB index reader. --=20 You are receiving this mail because: You are on the CC list for the bug.=