Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 81ae9e6

Browse files
committed
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
1 parent 3536b85 commit 81ae9e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/activity/pgstat_shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ pgstat_reinit_entry(PgStat_Kind kind, PgStatShared_HashEntry *shhashent)
292292

293293
/* reinitialize content */
294294
Assert(shheader->magic == 0xdeadbeef);
295-
memset(shheader, 0, pgstat_get_kind_info(shhashent->key.kind)->shared_size);
296-
shheader->magic = 0xdeadbeef;
295+
memset(pgstat_get_entry_data(kind, shheader), 0,
296+
pgstat_get_entry_len(kind));
297297

298298
return shheader;
299299
}

0 commit comments

Comments
 (0)