pgsql: Fix crash if LockErrorCleanup() is called twice

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix crash if LockErrorCleanup() is called twice
Date: 2025-03-28 18:20:33
Message-ID: E1tyEJl-001Sig-1G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix crash if LockErrorCleanup() is called twice

The refactoring in commit 3c0fd64fec removed the clearing of
awaitedLock from LockErrorCleanup(). It's still needed, otherwise
LockErrorCleanup() during abort processing will try to update the
LOCALLOCK struct even after the lock has already been released. Put it
back.

Reported-by: Richard Guo <guofenglinux(at)gmail(dot)com>
Reported-by: Robins Tharakan <tharakan(at)gmail(dot)com>
Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/CAMbWs4_dNX1SzBmvFdoY-LxJh_4W_BjtVd5i008ihfU-wFF=eg(at)mail(dot)gmail(dot)com
Discussion: https://www.postgresql.org/message-id/18832-38e5575b1bbd7277@postgresql.org
Discussion: https://www.postgresql.org/message-id/e11a30e5-c0d8-491d-8546-3a1b50c10ad4@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/51a0382e8d8793b5cc89b69285e5ecdffe03c2bf

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 9 +++++++++
src/backend/storage/lmgr/proc.c | 2 ++
src/include/storage/lock.h | 1 +
3 files changed, 12 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2025-03-28 19:50:07 pgsql: Optimize popcount functions with ARM Neon intrinsics.
Previous Message Nathan Bossart 2025-03-28 17:29:01 pgsql: Rename TRY_POPCNT_FAST to TRY_POPCNT_X86_64.