mirror of
https://github.com/postgres/postgres.git
synced 2026-04-09 11:06:21 -04:00
Fix valgrind failure
Buildfarm member skink reports that the new REPACK code is trying to write uninitialized bytes to disk, which correspond to padding space in the SerializedSnapshotData struct. Silence that by initializing the memory in SerializeSnapshot() to all zeroes. Co-authored-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com> Co-authored-by: Álvaro Herrera <alvherre@kurilemu.de> Discussion: https://postgr.es/m/1976915.1775537087@sss.pgh.pa.us
This commit is contained in:
parent
8c3e22a8f8
commit
5bcc3fbd19
2 changed files with 2 additions and 2 deletions
|
|
@ -342,8 +342,8 @@ export_initial_snapshot(Snapshot snapshot, DecodingWorkerShared *shared)
|
|||
/* To make restoration easier, write the snapshot size first. */
|
||||
BufFileWrite(file, &snap_size, sizeof(snap_size));
|
||||
BufFileWrite(file, snap_space, snap_size);
|
||||
pfree(snap_space);
|
||||
BufFileClose(file);
|
||||
pfree(snap_space);
|
||||
|
||||
/* Increase the counter to tell the backend that the file is available. */
|
||||
SpinLockAcquire(&shared->mutex);
|
||||
|
|
|
|||
|
|
@ -1735,7 +1735,7 @@ EstimateSnapshotSpace(Snapshot snapshot)
|
|||
void
|
||||
SerializeSnapshot(Snapshot snapshot, char *start_address)
|
||||
{
|
||||
SerializedSnapshotData serialized_snapshot;
|
||||
SerializedSnapshotData serialized_snapshot = {0};
|
||||
|
||||
Assert(snapshot->subxcnt >= 0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue