From: Robert Haas Date: Mon, 31 Mar 2014 18:32:12 +0000 (-0400) Subject: Mark FastPathStrongRelationLocks volatile. X-Git-Tag: REL9_4_BETA1~249 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bc15a8bfbc7856bc3426dc9ab99567eebbb64d3;p=postgresql Mark FastPathStrongRelationLocks volatile. Otherwise, the compiler might decide to move modifications to data within this structure outside the enclosing SpinLockAcquire / SpinLockRelease pair, leading to shared memory corruption. This may or may not explain a recent lmgr-related buildfarm failure on prairiedog, but it needs to be fixed either way. --- diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 6335129ac2..fd6cd0647e 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -238,7 +238,7 @@ typedef struct uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS]; } FastPathStrongRelationLockData; -static FastPathStrongRelationLockData *FastPathStrongRelationLocks; +static volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks; /*