From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99D463858D3C; Wed, 13 Sep 2023 14:32:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99D463858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694615525; bh=rr8p7a9Kf/HFj819AwMFCM5kIRsqeEv94RGa5BbDHvs=; h=From:To:Subject:Date:From; b=V8DXnhLHCiwZv0lV0QkArfDwsx8NMTnl43E1bYB/XEjtv5X7WDsuOaq8B+c9mzGBI 0wLMVxFO5gtAkyB3qtFW3+pYZl04qerXsmN3JAd0huteJAsfy4NpqSdjo90lmqdrWd feKV+tbFzEgz7hISx6VKgqIjPI5VE2haooYFa7gc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/30846] New: [gdb/symtab] incorrect parent for forward spec (inter-cu case) Date: Wed, 13 Sep 2023 14:32:04 +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 attachments.created 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30846 Bug ID: 30846 Summary: [gdb/symtab] incorrect parent for forward spec (inter-cu case) 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: --- Created attachment 15109 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15109&action=3Ded= it Dwarf assembly test-case demonstrating problem Consider the attached dwarf assembly test-case, an inter-cu variant of gdb.dwarf2/forward-spec.exp. When we run it we get: ... FAIL: gdb.dwarf2/forward-spec-inter-cu.exp: v has a parent ... because: ... [3] ((cooked_index_entry *) 0x7f3b54005250)^M name: v^M canonical: v^M qualified: v^M DWARF tag: DW_TAG_variable^M flags: 0x2 [IS_STATIC]^M DIE offset: 0xbe^M parent: ((cooked_index_entry *) 0)^M ... The dwarf for the test-case is: ... Compilation Unit @ offset 0xb1: ... <0>: Abbrev Number: 2 (DW_TAG_compile_unit) DW_AT_language : 4 (C++) <1>: Abbrev Number: 3 (DW_TAG_variable) DW_AT_specification: <0xe2> DW_AT_location : 3 byte block: 8 17 9f (DW_OP_const1u: 23; DW_OP_stack_value) ... Compilation Unit @ offset 0xc8: ... <0>: Abbrev Number: 2 (DW_TAG_compile_unit) DW_AT_language : 4 (C++) ... <1>: Abbrev Number: 4 (DW_TAG_namespace) DW_AT_name : ns <2>: Abbrev Number: 5 (DW_TAG_variable) DW_AT_name : v DW_AT_type : <0xd5> DW_AT_declaration : 1 ... By looking at the compile unit offsets: ... $ grep @ READELF Compilation Unit @ offset 0x0: Compilation Unit @ offset 0x45: Compilation Unit @ offset 0x84: Compilation Unit @ offset 0xa6: Compilation Unit @ offset 0xb1: Compilation Unit @ offset 0xc8: Compilation Unit @ offset 0xeb: Compilation Unit @ offset 0xf6: Compilation Unit @ offset 0x2ae: ... we see that the 5th and 6th CUs are involved. And then using the parallel_for_each_debug output: ... Parallel for: n_elements: 9^M Parallel for: total_size: 720^M Parallel for: size_per_thread: 60^M Parallel for: elements on worker thread 0 : 1 (size: 69)^M Parallel for: elements on worker thread 1 : 1 (size: 63)^M Parallel for: elements on worker thread 2 : 3 (size: 68)^M Parallel for: elements on worker thread 3 : 3 (size: 486)^M Parallel for: elements on worker thread 4 : 0 (size: 0)^M Parallel for: elements on worker thread 5 : 0 (size: 0)^M Parallel for: elements on worker thread 6 : 0 (size: 0)^M Parallel for: elements on worker thread 7 : 0 (size: 0)^M Parallel for: elements on worker thread 8 : 0 (size: 0)^M Parallel for: elements on worker thread 9 : 0 (size: 0)^M Parallel for: elements on worker thread 10 : 0 (size: 0)^M Parallel for: elements on worker thread 11 : 0 (size: 0)^M Parallel for: elements on main thread : 1 (size: 0)^M ... we can conclude that the 5th CU is in the 3rd shard, and the 6th CU is in t= he 4th shard. So we managed to catch the inter-shard case. [ It would be good to have a parallel-for mode that reserves a shard per it= em, such that we can enforce this, independent of factors like amount of worker-threads. ] FWIW, also if we set worker-threads to 0, this still fails. Both the inter-shard and the intra-shard inter-cu case are broken. --=20 You are receiving this mail because: You are on the CC list for the bug.=