From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 2C2F73858C78 for ; Wed, 10 Apr 2024 03:46:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C2F73858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2C2F73858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712720769; cv=none; b=GxU9/BfHZ7Wub9fGdv6LdAHBggrM7PYy4hepKFcRE4B/IBsTFwQh+ZHTuSoviEYUCrq/OZRYlwnqoYjR3zA3cYTM2f1ZtDxzHMiMj3IlpfiWG1M58TzrH7DOh1bbZMOr57Lroe404EirTKEWYZ5/+4caJDOhfrq83qCfss+zvlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712720769; c=relaxed/simple; bh=opum7yo0nAIjFEaXvfHOupx2v7Q6/nWH1E0O5R0An88=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=VmFwok5tMiNQawqxdoFKshYutdZF0jiU3C8lsQIg+cKgfdAe6Z6ZDgQ1yRrm9/3vjCPHfJiDbWd0/XvWw0000USSsOWqAIHiZ8EF4nB2HThuzkpl3KHa/q6BiGdFsf30/kv2ZtF4V/SvH6MZeGogPauv5x/gkAuOIPBN7yKGt64= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ed691fb83eso1799735b3a.1 for ; Tue, 09 Apr 2024 20:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712720766; x=1713325566; darn=sourceware.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9C/oT319u0CutTiIoZ6zYya/u4y+vMQ0R2snJGXqyw0=; b=YOyQaC5ts0SpSzJzp06ogt2KH8pJd84P306ktx52NdSEIJg9tykcZ+1P7CtX4GU6QO Qw2z0OqCuEMc+UFBrCFfr6acncWNaOlrGTDcTZVnWnoA0o6cE7VDJaJTXbB9ctn/3Yds YbZdUdVOqIY5Qs4FlnC4ghNrB1JHXcjG38FDk+eFSGbJoDkc8rvuB4F3u/lW2iFbilaj k1/yerOtVH0wrv76DIKVHcrs1GxPzgLGsUgiNFcDVz/YNsti4ylo4m/YP8Tvs5T24lI/ 1oGoG76xdjl1nsu3hIbG6pRJTBH4mz1JnLV5Th4NDLIQzkz2ukdTCye7FQkXYgLoEPz6 Av5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712720766; x=1713325566; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9C/oT319u0CutTiIoZ6zYya/u4y+vMQ0R2snJGXqyw0=; b=pRZ6wSFd59ViiG4zfRU+lS12nja4oevAgqbdUIiIWUXkV4WJVDJCExTyNvgCG7WPx6 I+Kkxyo2oL1VeR2Z9jSQOiWvRFr1NJ5P1gNhI7GtyB5gwlIxcTNbhlwurKuEpgG7pja1 8I20VMfPq9gw8yySoAsR2Umiotxg4RSVQgqyMLgBXnsoKY0HHGtd0MBFY18owh2stypF Ob2eHW+1W2bkj1c8hi7aCC3fHEGLROiPicshdtEh2G64tzLWVyFa6TeSsvttTuP0iB9X tVATwUfSTLQrs2K+OSN5YYERD5s25gWHdmg8ca8z8pFyvR8vDnmnXctLNikCSx+pxtFV AV4w== X-Gm-Message-State: AOJu0YyRMzKAZaRGUgsctEBcQ1n/0Ru/24/VvT5q5txhpN1KJNrTweFO ylxVyd7s83TCsjbAnomm/lk6qB/nivYKwUDnO0mXDwfIwWm/chvqZwHAjwZt X-Google-Smtp-Source: AGHT+IH21vwcLNL0IdH+dxy9q25MJrDt8HpBhV9s4+kSyU8fHayGDxsPRPvJf3+rgIsz5d6Z7I7Tng== X-Received: by 2002:a05:6a20:9f9a:b0:1a7:a564:14db with SMTP id mm26-20020a056a209f9a00b001a7a56414dbmr2109343pzb.24.1712720765716; Tue, 09 Apr 2024 20:46:05 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id w16-20020a1709026f1000b001e3d38c9e70sm8090538plk.125.2024.04.09.20.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 20:46:05 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id DF7941140035; Wed, 10 Apr 2024 13:16:02 +0930 (ACST) Date: Wed, 10 Apr 2024 13:16:02 +0930 From: Alan Modra To: Tom Tromey Cc: binutils@sourceware.org Subject: Re: [PATCH 2/2] Avoid cache race in bfd_check_format_matches Message-ID: References: <20240324211229.1444550-1-tom@tromey.com> <20240324211229.1444550-3-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240324211229.1444550-3-tom@tromey.com> X-Spam-Status: No, score=-3027.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Mar 24, 2024 at 03:08:06PM -0600, Tom Tromey wrote: > 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. This all looks OK. -- Alan Modra Australia Development Lab, IBM