Content-Length: 262081 | pFad | http://github.com/postgrespro/postgres/commit/bd88404d3cda53810e0b0144713c4b1a1dd965a8

CF Fix crash with RemoveFromWaitQueue() when detecting a deadlock. · postgrespro/postgres@bd88404 · GitHub
Skip to content

Commit bd88404

Browse files
Fix crash with RemoveFromWaitQueue() when detecting a deadlock.
Commit 5764f61 used dclist_delete_from() to remove the proc from the wait queue. However, since it doesn't clear dist_node's next/prev to NULL, it could call RemoveFromWaitQueue() twice: when the process detects a deadlock and then when cleaning up locks on aborting the transaction. The waiting lock information is cleared in the first call, so it led to a crash in the second call. Backpatch to v16, where the change was introduced. Bug: #18031 Reported-by: Justin Pryzby, Alexander Lakhin Reviewed-by: Andres Freund Discussion: https://postgr.es/m/ZKy4AdrLEfbqrxGJ%40telsasoft.com Discussion: https://postgr.es/m/18031-ebe2d08cb405f6cc@postgresql.org Backpatch-through: 16
1 parent d9eb92c commit bd88404

File tree

1 file changed

+1
-1
lines changed
  • src/backend/storage/lmgr

1 file changed

+1
-1
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ RemoveFromWaitQueue(PGPROC *proc, uint32 hashcode)
18811881
Assert(0 < lockmethodid && lockmethodid < lengthof(LockMethods));
18821882

18831883
/* Remove proc from lock's wait queue */
1884-
dclist_delete_from(&waitLock->waitProcs, &proc->links);
1884+
dclist_delete_from_thoroughly(&waitLock->waitProcs, &proc->links);
18851885

18861886
/* Undo increments of request counts by waiting process */
18871887
Assert(waitLock->nRequested > 0);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/bd88404d3cda53810e0b0144713c4b1a1dd965a8

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy