From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF89C385DC21; Thu, 18 Jan 2024 12:37:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF89C385DC21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705581465; bh=D5FOT3nsf2YskrKD31u3VV+Hp/zx58mnq2ivStxHkY8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UUfHQ2uYYZjoah0u0ZBHx+yEBJV1loCMwz61WDKwzmYlhLsW2trJv2Xnn1+tpqfKb OFooDEqsDssV+31FEFDeeBQi3NC7+4gEV40ITN3W7ylovoMzaEyx7+okkf+15O8NKj ekxBYnPTuWsJj10wtAbEcO6i+bcSOKtOj+Mc+Gvc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31262] [gdb] ThreadSanitizer: data raceindex-cache.c:76 in index_cache::enable() Date: Thu, 18 Jan 2024 12:37:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb 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: 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=3D31262 --- Comment #1 from Tom de Vries --- I guess the problem is that we're capturing index_cache_store_context in a worker thread (T5) while the capturing is supposed to happen in the main thread: ... /* Information to be captured in the main thread, and to be used by worker= =20=20=20=20=20=20 threads during store (). */ struct index_cache_store_context { friend class index_cache; index_cache_store_context (const index_cache &ic, dwarf2_per_bfd *per_bfd= ); ... In other words, this should trigger: ... diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c index 7ddd7b3f974..50db5f92b40 100644 --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c @@ -92,6 +92,7 @@ index_cache_store_context::index_cache_store_context (con= st index_cache &ic, dwarf2_per_bfd *per_b= fd) : m_enabled (ic.enabled ()) { + gdb_assert (is_main_thread ()); if (!m_enabled) return; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=