From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4A1AB3854803; Tue, 2 Feb 2021 07:37:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A1AB3854803 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/24620] [cc-with-gdb-index] SIGSEGV in write_one_signatured_type in fission-reread Date: Tue, 02 Feb 2021 07:37:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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: 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 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, 02 Feb 2021 07:37:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24620 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2bd3e4b8d258= 0839a457e221d4e1e09105248215 commit 2bd3e4b8d2580839a457e221d4e1e09105248215 Author: Tom de Vries Date: Tue Feb 2 08:37:45 2021 +0100 [gdb/symtab] Fix assert in write_one_signatured_type When running test-case gdb.dwarf2/fission-reread.exp with target board cc-with-gdb-index, we run into an abort during the generation of the gdb-index by cc-with-tweaks.sh: ... build/gdb/testsuite/cache/gdb.sh: line 1: 27275 Aborted (core dumped) ... This can be reproduced on the command line like this: ... $ gdb -batch ./outputs/gdb.dwarf2/fission-reread/fission-reread \ -ex 'save gdb-index ./outputs/gdb.dwarf2/fission-reread' warning: Could not find DWO TU fission-reread.dwo(0x9022f1ceac7e8b19) \ referenced by TU at offset 0x0 [in module fission-reread] warning: Could not find DWO CU fission-reread.dwo(0x807060504030201) \ referenced by CU at offset 0x561 [in module fission-reread] Aborted (core dumped) ... The abort is a segfault due to a using a nullptr psymtab in write_one_signatured_type. The problem is that we're trying to write index entries for the type un= it with signature: ... (gdb) p /x entry->signature $2 =3D 0x9022f1ceac7e8b19 ... which is a skeleton type unit: ... Contents of the .debug_types section: Compilation Unit @ offset 0x0: Length: 0x4a (32-bit) Version: 4 Abbrev Offset: 0x165 Pointer Size: 4 Signature: 0x9022f1ceac7e8b19 Type Offset: 0x0 <0><17>: Abbrev Number: 2 (DW_TAG_type_unit) <18> DW_AT_comp_dir : /tmp/src/gdb/testsuite <2f> DW_AT_GNU_dwo_name: fission-reread.dwo <42> DW_AT_GNU_pubnames: 0x0 <46> DW_AT_GNU_pubtypes: 0x0 <4a> DW_AT_GNU_addr_base: 0x0 ... referring to a .dwo file, but as the warnings show, the .dwo file is not found. Fix this by skipping the type unit in write_one_signatured_type if psymtab =3D=3D nullptr. Tested on x86_64-linux. gdb/ChangeLog: 2021-02-02 Tom de Vries PR symtab/24620 * dwarf2/index-write.c (write_one_signatured_type): Skip if psymtab =3D=3D nullptr. gdb/testsuite/ChangeLog: 2021-02-02 Tom de Vries PR symtab/24620 * gdb.dwarf2/fission-reread.exp: Add test-case. --=20 You are receiving this mail because: You are on the CC list for the bug.=