From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E71339450E7; Mon, 14 Jun 2021 14:56:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E71339450E7 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/27981] New: [gdb/symtab] CU importing itself causes gdb to segfault Date: Mon, 14 Jun 2021 14:56:44 +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: Mon, 14 Jun 2021 14:56:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27981 Bug ID: 27981 Summary: [gdb/symtab] CU importing itself causes gdb to segfault 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: --- With a test-case containing the following CU: ... Compilation Unit @ offset 0xc7: Length: 0x38 (32-bit) Version: 4 Abbrev Offset: 0x64 Pointer Size: 8 <0>: Abbrev Number: 2 (DW_TAG_compile_unit) DW_AT_language : 2 (non-ANSI C) DW_AT_name : main.c <1>: Abbrev Number: 3 (DW_TAG_imported_unit) DW_AT_import : <0xd2> [Abbrev Number: 2 (DW_TAG_compile_unit)] <1>: Abbrev Number: 4 (DW_TAG_base_type) DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) DW_AT_name : int <1>: Abbrev Number: 5 (DW_TAG_subprogram) DW_AT_name : main DW_AT_low_pc : 0x4004a7 DW_AT_high_pc : 0x4004b2 DW_AT_type : <0xe0> <101> DW_AT_external : 1 <1><102>: Abbrev Number: 0 ... we get GDB to crash ... $ gdb -q -batch outputs/gdb.dwarf2/import-cycle/import-cycle -ex "p main" Aborted (core dumped) ... In more detail, we run out of stack with a sigsegv: ... Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. 0x00000000008e0366 in recursively_search_psymtabs(partial_symtab *, objfile= *, block_search_flags, domain_enum, search_domain, const lookup_name_info &, gdb::function_view) (ps=3D0x218bc90, objfile=3D0x1ad0140, search_flags=3D..., domain=3DVAR_DOMAIN,=20 search=3DALL_DOMAIN,=20 lookup_name=3D,=20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=