From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB2723856DDD; Tue, 2 Aug 2022 07:16:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB2723856DDD From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29436] New: [gdb/symtab] read.c:2352: internal-error: read_addrmap_from_aranges: Assertion `insertpair.second' failed. Date: Tue, 02 Aug 2022 07:16:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vries 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: 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, 02 Aug 2022 07:16:33 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29436 Bug ID: 29436 Summary: [gdb/symtab] read.c:2352: internal-error: read_addrmap_from_aranges: Assertion `insertpair.second' failed. Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I recently added this assert: ... /* Assume no duplicate offsets in all_comp_units. */ gdb_assert (insertpair.second); ... in read_addrmap_from_aranges, and I was curious if I could trigger it. So I started out with: ... $ gcc ~/hello.c -g -save-temps ... and then manually added this (copied and modified from gdb.dwarf2/clang-debug-names.exp.tcl): ... .ident "GCC: (SUSE Linux) 7.5.0" + .section .debug_names + .4byte .Ldebug_names_end - .Ldebug_names_start + .Ldebug_names_start: + .short 5 /* Header: version */ + .short 0 /* Header: padding */ + .long 2 /* Header: compilation unit count */ + .long 0 /* Header: local type unit count */ + .long 0 /* Header: foreign type unit count */ + .long 0 /* Header: bucket count */ + .long 0 /* Header: name count */ + .long 1 + /* Header: abbreviation table size */= =20 + .long 0 /* Header: augmentation string size */ + .long .Ldebug_info0 /* Compilation unit 0 */ + .long .Ldebug_info0 /* Compilation unit 0 */ + .byte 0 + .p2align 2 + .Ldebug_names_end: + .section .note.GNU-stack,"",@progbits ... in hello.s. [ Actually, I started out with abbreviation table size 0, but gdb doesn't g= rok it, it always expects a terminating byte. ] This is an empty index, and this bit: ... /* Don't use the index if it's empty. */ if (map->name_count =3D=3D 0) return false; ... in dwarf2_read_debug_names prevents us from using it, but after disabling i= t we have indeed: ... $ gdb -q -batch a.out src/gdb/dwarf2/read.c:2352: internal-error: read_addrmap_from_aranges: Assertion `insertpair.second' failed. ... We should handle this in create_cus_from_debug_names_list or some such.=20 Likewise for .gdb_index. Note btw that the standard bit that is violated here is: "For a per-module index, there will be one CU entry for each compile unit in the module". --=20 You are receiving this mail because: You are on the CC list for the bug.=