aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-04-06 23:35:56 -0700
committerAndres Freund <andres@anarazel.de>2022-04-06 23:35:56 -0700
commit81ae9e65887476b4c55aaad276a8010a459a41ce (patch)
treea45d952ff14f92ce4e6b5ff84c05c350b9635ea6
parent3536b851adb275e2f49a80030111e84abc0736ba (diff)
downloadpostgresql-81ae9e65887476b4c55aaad276a8010a459a41ce.tar.gz
postgresql-81ae9e65887476b4c55aaad276a8010a459a41ce.zip
pgstat: prevent fix pgstat_reinit_entry() from zeroing out lwlock.
Zeroing out an lwlock in a normal build turns out to not trigger any alarms, if nobody can use the lwlock at that moment (as the case here). But with --disable-spinlocks --disable-atomics, the sema field needs to be initialized. We probably should make sure that this fails on more common configurations as well... Per buildfarm animal rorqual
-rw-r--r--src/backend/utils/activity/pgstat_shmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/activity/pgstat_shmem.c b/src/backend/utils/activity/pgstat_shmem.c
index a32740b2f6e..b270c504ea6 100644
--- a/src/backend/utils/activity/pgstat_shmem.c
+++ b/src/backend/utils/activity/pgstat_shmem.c
@@ -292,8 +292,8 @@ pgstat_reinit_entry(PgStat_Kind kind, PgStatShared_HashEntry *shhashent)
/* reinitialize content */
Assert(shheader->magic == 0xdeadbeef);
- memset(shheader, 0, pgstat_get_kind_info(shhashent->key.kind)->shared_size);
- shheader->magic = 0xdeadbeef;
+ memset(pgstat_get_entry_data(kind, shheader), 0,
+ pgstat_get_entry_len(kind));
return shheader;
}