pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix double-release of spinlock
Date: Mon, 29 Jul 2024 15:24:52 +0000
Message-ID: <E1sYSF2-001lEB-D1@gemulon.postgresql.org> (raw)

Fix double-release of spinlock

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.

In the passing, fix a type in comment and add an assertion that the
procNumber passed to SendProcSignal looks valid.

Discussion: https://www.postgresql.org/message-id/b8ce284c-18a2-4a79-afd3-1991a2e7d246@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0393f542d72c6182271c392d9a83d0fc775113c7

Modified Files
--------------
src/backend/storage/ipc/procsignal.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



view thread (9+ messages)  latest in thread

Message-ID: <E1sYSF2-001lEB-D1@gemulon.postgresql.org>
Permalink:  ../E1sYSF2-001lEB-D1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sYSF2-001lEB-D1@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix double-release of spinlock
  In-Reply-To: <E1sYSF2-001lEB-D1@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox