Re: Fix uninitialized xl_running_xacts padding - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Re: Fix uninitialized xl_running_xacts padding
Date
Msg-id CAN4CZFOQjNQNSPKx+LKfHkcO7KFB+ZjmdXEyhO+sYs4Qiqj-+Q@mail.gmail.com
Whole thread
In response to Re: Fix uninitialized xl_running_xacts padding  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
> Until now we just accepted that WAL insertions can contain
> random padding. If we don't want that, we should go around and make sure that
> there is no padding (or padding is initialized) for *all* WAL records,
> document that as the rule, and remove the relevant valgrind suppressions.

While this would be a nice requirement, I don't think we can enforce
it for extensions, only for the core, as C has no capabilities to add
a rule for this.

But we could enforce it for the core code, what do you think about a
script that similarly to headercheck detects WAL record issues
automatically? That's also good for detecting the current issues, see
attached script and the results I get when executing it on the current
master branch.

Notes:
* It tries to find the related SizeOf macros, and if that exists,
accepts trailing padding if it's correctly calculated. But it
currently doesn't verify that the SizeOf macro is currently used
everywhere (that also seems doable with some greps)
* It also has a whitelist for non wal structs in these headers and 2
cases where we explicitly document that padding is ok (not sure if
this latter should be really in the whitelist or not)

Attachment

pgsql-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Next
From: Andreas Karlsson
Date:
Subject: Improve pgindent's formatting named fields in struct literals and varidic functions