From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A10E93858C60; Mon, 24 Jul 2023 09:56:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A10E93858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690192601; bh=1a3N9+7tC4vbfDvcAG9YHrxcivWx2vXSQPBTmMp51n8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SDUzB7rwjZS5kuBhAqyJ0UfrTaapv7alwyj9YCU5CB+wzvetdHhKnbzkxUV7CKoUa aEEX0bVVKlEq8bnM36PCReK1DeDSabwkJdtbKoC+uq1XvnRxpsDIBwJixhNGEZ48ih L984SYh9KV3hDJ0nPimrlqKX3v4zHbBLaaPSA4Yc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/30672] [gdb/symtab] data race in cooked_index_shard::do_finalize() / cooked_index_entry::write_scope Date: Mon, 24 Jul 2023 09:56:40 +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: 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: cc 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=3D30672 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at sourceware dot o= rg --- Comment #1 from Tom de Vries --- Tentative patch: ... diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 25635d9b72e..8134f8dbbfc 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -68,6 +68,25 @@ language_requires_canonicalization (enum language lang) /* See cooked-index.h. */ +cooked_index_entry::cooked_index_entry (sect_offset die_offset_, + enum dwarf_tag tag_, + cooked_index_flag flags_, + const char *name_, + const cooked_index_entry *parent_entry_, + dwarf2_per_cu_data *per_cu_) + : name (name_), + tag (tag_), + flags (flags_), + die_offset (die_offset_), + parent_entry (parent_entry_), + per_cu (per_cu_) +{ + if (!language_requires_canonicalization (per_cu->lang ())) + canonical =3D name_; +} + +/* See cooked-index.h. */ + int cooked_index_entry::compare (const char *stra, const char *strb, comparison_mode mode) @@ -343,8 +362,9 @@ cooked_index_shard::do_finalize () for (cooked_index_entry *entry : m_entries) { - /* Note that this code must be kept in sync with - language_requires_canonicalization. */ + if (!language_requires_canonicalization (entry->per_cu->lang ())) + continue; + gdb_assert (entry->canonical =3D=3D nullptr); if ((entry->flags & IS_LINKAGE) !=3D 0) entry->canonical =3D entry->name; @@ -388,7 +408,7 @@ cooked_index_shard::do_finalize () } } else - entry->canonical =3D entry->name; + gdb_assert_not_reached ("Unhandled canonicalization"); }-- m_names.shrink_to_fit (); diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 0d6f3e5aa0e..10207305109 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -78,15 +78,7 @@ struct cooked_index_entry : public allocate_on_obstack cooked_index_entry (sect_offset die_offset_, enum dwarf_tag tag_, cooked_index_flag flags_, const char *name_, const cooked_index_entry *parent_entry_, - dwarf2_per_cu_data *per_cu_) - : name (name_), - tag (tag_), - flags (flags_), - die_offset (die_offset_), - parent_entry (parent_entry_), - per_cu (per_cu_) - { - } + dwarf2_per_cu_data *per_cu_); /* Return true if this entry matches SEARCH_FLAGS. */ bool matches (block_search_flags search_flags) const ... --=20 You are receiving this mail because: You are on the CC list for the bug.=