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 1sYSMA-00BViC-Dx for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 15:32:14 +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 1sYSM9-000hFn-0g for pgsql-committers@arkaria.postgresql.org; Mon, 29 Jul 2024 15:32:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYSM8-000hFf-Pf for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 15:32:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYSM6-0025Yn-LM for pgsql-committers@lists.postgresql.org; Mon, 29 Jul 2024 15:32:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46TFVu952600758; Mon, 29 Jul 2024 11:31:57 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-committers@lists.postgresql.org, Andres Freund Subject: Re: pgsql: Fix double-release of spinlock In-reply-to: References: Comments: In-reply-to Heikki Linnakangas message dated "Mon, 29 Jul 2024 15:24:52 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2600756.1722267116.1@sss.pgh.pa.us> Date: Mon, 29 Jul 2024 11:31:56 -0400 Message-ID: <2600757.1722267116@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. regards, tom lane