pgsql: Adjust Valgrind macro usage to protect chunk headers

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Adjust Valgrind macro usage to protect chunk headers
Date: 2023-04-15 00:01:05
Message-ID: E1pnTLk-0036ko-BJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Adjust Valgrind macro usage to protect chunk headers

Prior to this commit we only ever protected MemoryChunk's requested_size
field with Valgrind NOACCESS. This means that if the hdrmask field is
ever accessed accidentally then we're not going to get any warnings from
Valgrind about it. Valgrind would have warned us about the problem fixed
in 92957ed98 had we already been doing this.

Per suggestion from Tom Lane

Reviewed-by: Richard Guo
Discussion: https://postgr.es/m/1650235.1672694719@sss.pgh.pa.us
Discussion: https://postgr.es/m/CAApHDvr=FZNGbj252Z6M9BSFKoq6BMxgkQ2yEAGUYoo7RquqZg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/414d66220adb9189951fb4d410470f9f36f9cbd1

Modified Files
--------------
src/backend/utils/mmgr/alignedalloc.c | 36 ++++++++++++----
src/backend/utils/mmgr/aset.c | 78 ++++++++++++++++++++---------------
src/backend/utils/mmgr/generation.c | 57 ++++++++++++-------------
src/backend/utils/mmgr/mcxt.c | 22 +++++++++-
src/backend/utils/mmgr/slab.c | 51 ++++++++++++++++++++---
5 files changed, 170 insertions(+), 74 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-04-15 15:20:55 pgsql: Remove some non-ASCII symbols from a comment.
Previous Message Andres Freund 2023-04-14 18:38:37 pgsql: Support RBM_ZERO_AND_CLEANUP_LOCK in ExtendBufferedRelTo(), add