From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B614385841C; Tue, 16 Apr 2024 22:53:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B614385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713308033; bh=8wacTdZ8jgXdVkgxNLjnaMfZIZ5WQqMj+RXhOFu31rM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J1u6zjTQVTHiiWns/iSpkZh+itTXQl76XZjo0WGos7IP8bycG0w53hMeYmb3y9RIF 0pGsN+pWrxA1k/uzLkDxbX2/3SBgkoGBYCxSbVlLQuQsZxHerj2e4M5t0Vq9BDQQ3q +MG92wAj0x/Kxw92BYxxMYIbc8F8gS1KtnxCGV10= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31264] [gdb] ThreadSanitizer: data race format.c:132 in bfd_preserve_save Date: Tue, 16 Apr 2024 22:53:51 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: tromey at sourceware dot org X-Bugzilla-Target-Milestone: 15.1 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=3D31264 --- Comment #13 from Sourceware Commits --- The master branch has been updated by Tom Tromey : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D20bf7711bce2= 188c1af985a87df23c4653c2cc7a commit 20bf7711bce2188c1af985a87df23c4653c2cc7a Author: Tom Tromey Date: Sat Mar 23 15:19:20 2024 -0600 Avoid cache race in bfd_check_format_matches Running the gdb test suite with the thread sanitizer enabled shows a race when bfd_check_format_matches and bfd_cache_close_all are called simultaneously on different threads. This patch fixes this race by having bfd_check_format_matches temporarily remove the BFD from the file descriptor cache -- leaving it open while format-checking proceeds. In this setup, the BFD client is responsible for closing the BFD again on the "checking" thread, should that be desired. gdb does this by calling bfd_cache_close in the relevant worker thread. An earlier version of this patch omitted the "possibly_cached" helper function. However, this ran into crashes in the binutils test suite involving the archive-checking abort in bfd_cache_lookup_worker. I do not understand the purpose of this check, so I've simply had the new function work around it. I couldn't find any comments explaining this situation, either. I suspect that there may still be races related to this case, but I don't think I have access to the platforms where gdb deals with archives. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31264 --=20 You are receiving this mail because: You are on the CC list for the bug.=