Re: Shared buffer access rule violations?

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Asim R P <apraveen(at)pivotal(dot)io>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, dkimura(at)pivotal(dot)io
Subject: Re: Shared buffer access rule violations?
Date: 2018-09-26 01:29:08
Message-ID: CAEepm=2_EnPc3n8=X_Q9UUQCGq_qU_A_nXSgHHFa4aBBDMQ88w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 9, 2018 at 12:59 PM Asim R P <apraveen(at)pivotal(dot)io> wrote:
> On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> > I wonder if it would be a better idea to enable Valgrind's memcheck to
> > mark buffers as read-only or read-write. We've considered doing
> > something like that for years, but for whatever reason nobody followed
> > through.
>
> Basic question: how do you mark buffers as read-only using memcheck
> tool? Running installcheck with valgrind didn't uncover any errors:
>
> valgrind --trace-children=yes pg_ctl -D datadir start
> make installcheck-parallel

Presumably with VALGRIND_xxx macros, but is there a way to make that
work for shared memory?

I like the mprotect() patch. This could be enabled on a build farm
animal. I guess it would either fail explicitly or behave incorrectly
for VM page size > BLCKSZ depending on OS, but at least on Linux/amd64
you have to go out of your way to get pages > 4KB so that seems OK for
a debugging feature.

I would like to do something similar with DSA, to electrify
superblocks and whole segments that are freed. That would have caught
a recent bug in DSA itself and in client code.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-09-26 01:34:01 Re: when set track_commit_timestamp on, database system abort startup
Previous Message Iwata, Aya 2018-09-26 01:24:37 RE: libpq debug log