pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add Valgrind buffer access instrumentation.
Date: Sat, 18 Jul 2020 00:50:34 +0000
Message-ID: <E1jwb3i-000083-RM@gemulon.postgresql.org> (raw)

Add Valgrind buffer access instrumentation.

Teach Valgrind memcheck to maintain the "defined-ness" of each shared
buffer based on whether the backend holds at least one pin at the point
it is accessed by access method code.  Bugs like the one fixed by commit
b0229f26 can be detected using this new instrumentation.

Note that backends running with Valgrind naturally have their own
independent ideas about whether any given byte in shared memory is safe
or unsafe to access.  There is no risk that concurrent access by
multiple backends to the same shared memory will confuse Valgrind's
instrumentation, because everything already works at the process level
(or at the memory mapping level, if you prefer).

Author: Álvaro Herrera, Peter Geoghegan
Reviewed-By: Anastasia Lubennikova
Discussion: https://postgr.es/m/20150723195349.GW5596@postgresql.org
Discussion: https://postgr.es/m/CAH2-WzkLgyN3zBvRZ1pkNJThC=xi_0gpWRUb_45eexLH1+k2_Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1e0dfd166b3fa7fc79e4fad73b6fae056bab598a

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 18 ++++++++++++++++++
src/include/pg_config_manual.h      | 13 +++++++------
2 files changed, 25 insertions(+), 6 deletions(-)



Message-ID: <E1jwb3i-000083-RM@gemulon.postgresql.org>
Permalink:  ../E1jwb3i-000083-RM@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jwb3i-000083-RM@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: pg@bowt.ie
  Subject: Re: pgsql: Add Valgrind buffer access instrumentation.
  In-Reply-To: <E1jwb3i-000083-RM@gemulon.postgresql.org>
  References: <E1jwb3i-000083-RM@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox