From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D71693858C50; Sun, 17 Mar 2024 07:37:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D71693858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710661041; bh=G225bVRQ6n4QqjQdvACHelxSUOed1senEbvXjHIZ4bE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LVMPn8O2685BatQ+iBw8Hp/A/zQwvAmNvbWIYHY6z2RvOSG9WX5vqGtUNjVDhz0Qk 2BpwsypwjpUt1W0NCoYDIDN6zcQV/lS874a4j0x2/etf4T1TWIjsZH55jkHlL/AE/p /K3YIwsvdPWQ7b+aXDUzEbrfRAi2gCVcZv1DZGCc= From: "sungdgdhtryrt at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/31497] gdb internal fatal error while opening a core dump; binary built with '-gsplit-dwarf' Date: Sun, 17 Mar 2024 07:37:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: sungdgdhtryrt at gmail 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: Message-ID: In-Reply-To: References: 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=3D31497 --- Comment #2 from Hans --- Thank you for your very valuable advice. Your assumption about the missing read for the str_offset section was correct. Adding a read in read_dwo_str_index() prevents the crash and gdb is happy. Although the read will be called twice now in read_dwo_str_index() and read_str_index(). Thanks again for your help. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4afb026b8ce..a54e783d614 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -17483,6 +17483,12 @@ read_dwo_str_index (const struct die_reader_specs *reader, ULONGEST str_index) so assume the .debug_str_offsets section is DWARF5 as well, and parse the header. FIXME: Parse the header only once. */ unsigned int bytes_read =3D 0; + + // @@@ + struct objfile *objfile =3D reader->cu->per_objfile->objfile; + reader->dwo_file->sections.str_offsets.read (objfile); + // @@@ + bfd *abfd =3D reader->dwo_file->sections.str_offsets.get_bfd_owner (= ); const gdb_byte *p =3D reader->dwo_file->sections.str_offsets.buffer; --=20 You are receiving this mail because: You are on the CC list for the bug.=