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 1sYTQJ-00Bcqe-T3 for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 16:40:35 +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 1sYTQI-00140C-9Y for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 16:40:34 +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 1sYTQI-001404-2E for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 16:40:34 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYTQF-00241p-Iw for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 16:40:32 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 10C9F11400A4; Mon, 29 Jul 2024 12:40:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 29 Jul 2024 12:40:29 -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=1722271229; x=1722357629; bh=UD0hPb8pSY 5dJq0ROuWcR4MpsmzjAGEELIYQlvKe3cQ=; b=Xvp5nLfSafUgVZCSRZ1+9R/Dbi 70QN4rl4nL6UHUUtByrWrJj2IvCo/AEy+Y7btHDYNU5/3/NZhl9ojnh26wvOLzJy Rdngj+YmqYG/uB4WZSi8qEf0z6fsOIs0q2X3z/jBd5SJ0HQbJ0U6crEH9D4NutrT uNBOXXFwT/6rZuJ7clbraBZ0oSaRU92DYqHOgKkHqXfm5+qx0vb9payRh7t9Te+m akz86dbZbL5i9ZCvZw6FIVAJu5Qy1t2fY62fXI5kGuLdC+QM3MDjs9CVbQyXmbTr z88vHyptZaUfWp3D12e7jUn8CedFw0OOYKyXvYeL/f47R4b+bl17zT6p6maA== 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=1722271229; x=1722357629; bh=UD0hPb8pSY5dJq0ROuWcR4Mpsmzj AGEELIYQlvKe3cQ=; b=Ruhg0ND7BmmfgsW00N4nRFdo9FQbniOtuOPOWrjXP5qK D2GA4X1qicXeUEHHOOVcGA1fXwWea3u9OWvOAM2GjTKf4dHdpsyo+Wp+Z6W3nn1l pIsgDO0WLXTLQtw+LfsKVEtGwPw/E3bcyM0+uhsjtYaqNAHChQPiKo85IB+dc3o5 e+SPT0GllJT8o4IthKoNpAed8lYLtQWJpIplzmf3YGFR6pemE2eZMXcJ+z7I6Xc/ KMi875PhfdoIwuD3EILNPfbIRprd4vBzyNUeyEQb28jlz5scZSzmWHnBZ5h6SCY1 cod+pX+pEZ6FMscrC3ZDbP9dJsPMK4evwAIvlsjkwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrjedvgddutdehucetufdoteggodetrfdotf 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:40:28 -0400 (EDT) Date: Mon, 29 Jul 2024 09:40:26 -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: <20240729164026.yurg37tej34o76uk@awork3.anarazel.de> References: <2600757.1722267116@sss.pgh.pa.us> <20240729161846.kgiafbe2dtgabxgb@awork3.anarazel.de> <2802449.1722270793@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2802449.1722270793@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 12:33:13 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2024-07-29 11:31:56 -0400, Tom Lane wrote: > >> 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? FWIW, I quickly hacked that up, and it indeed quickly fails with 0393f542d72^ and passes with 0393f542d72. > I dunno, is that the only extra check that the --disable-spinlocks > implementation is providing? I think it also provides the (valuable!) check that spinlocks were actually initialized. But that again seems like something we'd be better off adding more general infrastructure for - nobody runs --disable-spinlocks locally, we shouldn't need to run this on the buildfarm to find problems like this. > I'm kind of allergic to putting Asserts into spinlocked code segments, > mostly on the grounds that it violates the straight-line-code precept. > I suppose it's not really that bad for tests that you don't expect > to fail, but still ... I don't think the spinlock implementation itself is really affected by that rule - after all, the --disable-spinlocks implementation actually consists out of several layers of external function calls (including syscalls in some cases!). Greetings, Andres Freund