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

Commit b19890d

Browse files
committed
Silence Valgrind complaint with EXEC_BACKEND
The padding bytes written to the backend params file were uninitialized. That's harmless because we don't access the padding bytes when we read the file back in, but Valgrind doesn't know that. In any case, clear the padding bytes to make Valgrind happy. Reported-by: Alexander Lakhin Discussion: https://www.postgresql.org/message-id/014768ed-8b39-c44f-b07c-098c87b1644c@gmail.com
1 parent 0d93ce3 commit b19890d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/postmaster/postmaster.c

+8
Original file line numberDiff line numberDiff line change
@@ -4490,6 +4490,14 @@ internal_forkexec(int argc, char *argv[], Port *port)
44904490
BackendParameters param;
44914491
FILE *fp;
44924492

4493+
/*
4494+
* Make sure padding bytes are initialized, to prevent Valgrind from
4495+
* complaining about writing uninitialized bytes to the file. This isn't
4496+
* performance critical, and the win32 implementation initializes the
4497+
* padding bytes to zeros, so do it even when not using Valgrind.
4498+
*/
4499+
memset(&param, 0, sizeof(BackendParameters));
4500+
44934501
if (!save_backend_variables(&param, port))
44944502
return -1; /* log made by save_backend_variables */
44954503

0 commit comments

Comments
 (0)