Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYT5N-00Bacl-MI for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 16:18:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYT5M-000tNw-8V for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 16:18:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYT5K-000tNe-28 for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 16:18:56 +0000 Received: from fout4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYT5G-0023gv-NB for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 16:18:52 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 54F671380290; Mon, 29 Jul 2024 12:18:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 29 Jul 2024 12:18:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1722269928; x=1722356328; bh=jnGvxXpeQw cpaHpkbB8ycrx+TO/IBIjHckfH6ZohN/g=; b=gAeycidVMe3sGURksEStSwzo24 VUemKg7uvDsz21jsO1vf7cAK624wTBd58P++dmPmifYyDIwU+C02Dbk1yy2yDhRB 7UeygQAojuzxlJ5DHqE4X1jzKAEZx44IhKozS+KPr5jXYZlEdJ9i5i3M6qN3txWd 4rqEi+ZwGF+tdHdIfPrACLza9beo3sytYpwYzbmcBTGvgTpJTwXt2pEWdqBP13Uy w/W3W5s+nfek/BOwN1RUQxY3F2NKUlnybFEkh0oMYdnYlm1FwFAVLMfQZSqroMDi njVqWXOJKVNsNqsykVXjCVZa77v47vdJlVfz82YGvTsxtMRfVsqbztX0KRfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1722269928; x=1722356328; bh=jnGvxXpeQwcpaHpkbB8ycrx+TO/I BIjHckfH6ZohN/g=; b=V8rVH7iT0FXSChGVn6MzzCr8qAnzjlXAsyg4oqmSaDWQ fkfCDoamNBGthyQwWuD/X7Su11f2NMxa1nvvkADEVxWG1JzkAI2fkSSLydYsh2sr ASkyACwj5l4hNFHRcZwLyx2H6+VwRvne5zxO1ERLlAU7qFqe6Ef6+pINxszQrGF4 dyptnol9nz1rgpH7VTQWNLu/AHjplTkCMz8Wo0jIyQbnJSLDMlG7VxWvwjSCxPSD s7zN6pBwyK5/Gs1ArWD7GXLCnt6WjexSxjK4MpW9wzYC+zjil0UYl6wO+1JvDid9 tV4WI9ZgBk5k50mtpnNknY7hFD3z8n0XGmiw8Zabhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrjedvgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jul 2024 12:18:47 -0400 (EDT) Date: Mon, 29 Jul 2024 09:18:46 -0700 From: Andres Freund To: Tom Lane Cc: Heikki Linnakangas , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix double-release of spinlock Message-ID: <20240729161846.kgiafbe2dtgabxgb@awork3.anarazel.de> References: <2600757.1722267116@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2600757.1722267116@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-07-29 11:31:56 -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > Commit 9d9b9d46f3 added spinlocks to protect the fields in ProcSignal > > flags, but in EmitProcSignalBarrier(), the spinlock was released > > twice. With most spinlock implementations, releasing a lock that's not > > held is not easy to notice, because most of the time it does nothing, > > but if the spinlock was concurrently acquired by another process, it > > could lead to more serious issues. Fortunately, with the > > --disable-spinlocks emulation implementation, it caused more visible > > failures. > > There was some recent discussion about getting rid of > --disable-spinlocks on the grounds that nobody would use > hardware that lacked native spinlocks. But now I wonder > if there is a testing/debugging reason to keep it. Seems it'd be a lot more straightforward to just add an assertion to the x86-64 spinlock implementation verifying that the spinlock isn't already free? Greetings, Andres Freund