pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix re-initialization of LWLock-related shared memory.
Date: Thu, 18 Sep 2025 14:56:22 +0000
Message-ID: <E1uzG3Z-001LcK-2Q@gemulon.postgresql.org> (raw)

Fix re-initialization of LWLock-related shared memory.

When shared memory is re-initialized after a crash, the named
LWLock tranche request array that was copied to shared memory will
no longer be accessible.  To fix, save the pointer to the original
array in postmaster's local memory, and switch to it when
re-initializing the LWLock-related shared memory.

Oversight in commit ed1aad15e0.  Per buildfarm member batta.

Reported-by: Michael Paquier <michael@paquier.xyz>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/aMoejB3iTWy1SxfF%40paquier.xyz
Discussion: https://postgr.es/m/f8ca018f-3479-49f6-a92c-e31db9f849d7%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c3cc2ab87d72a1ce17a7f574756158479ef32f20

Modified Files
--------------
src/backend/storage/lmgr/lwlock.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)



Message-ID: <E1uzG3Z-001LcK-2Q@gemulon.postgresql.org>
Permalink:  ../E1uzG3Z-001LcK-2Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uzG3Z-001LcK-2Q@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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix re-initialization of LWLock-related shared memory.
  In-Reply-To: <E1uzG3Z-001LcK-2Q@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