Re: Shared buffer access rule violations?

2019-02-03 Thread Andres Freund
Hi, On 2019-01-13 19:52:32 -0500, Tom Lane wrote: > Thomas Munro writes: > > On Thu, Aug 9, 2018 at 12:59 PM Asim R P wrote: > >> On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan wrote: > >>> I wonder if it would be a better idea to enable Valgrind's memcheck to > >>> mark buffers as read-only

Re: Shared buffer access rule violations?

2019-01-13 Thread Tom Lane
Thomas Munro writes: > On Thu, Aug 9, 2018 at 12:59 PM Asim R P wrote: >> On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan wrote: >>> I wonder if it would be a better idea to enable Valgrind's memcheck to >>> mark buffers as read-only or read-write. >> Basic question: how do you mark buffers as

Re: Shared buffer access rule violations?

2018-09-25 Thread Thomas Munro
On Thu, Aug 9, 2018 at 12:59 PM Asim R P wrote: > On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan 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

Re: Shared buffer access rule violations?

2018-08-08 Thread Asim R P
On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan 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:

Re: Shared buffer access rule violations?

2018-08-07 Thread Peter Geoghegan
On Tue, Aug 7, 2018 at 6:43 PM, Asim R P wrote: > Please find attached a patch to mark a shared buffer as read-write or > read-only using mprotect(). The idea is to catch violations of shared > buffer access rules. This patch was useful to detect the access > violations reported in this thread.

Re: Shared buffer access rule violations?

2018-08-07 Thread Asim R P
Please find attached a patch to mark a shared buffer as read-write or read-only using mprotect(). The idea is to catch violations of shared buffer access rules. This patch was useful to detect the access violations reported in this thread. The mprotect() calls are enabled by -DMPROTECT_BUFFER

Re: Shared buffer access rule violations?

2018-07-12 Thread Tom Lane
Asim R P writes: > On Tue, Jul 10, 2018 at 8:33 PM, Tom Lane wrote: >> Asim R P writes: >>> One can find several PageInit() calls with no content lock held. See, >>> for example: >>> fill_seq_with_data() >> That would be for a relation that no one else can even see yet, no? > Yes, when the

Re: Shared buffer access rule violations?

2018-07-11 Thread Asim R P
On Tue, Jul 10, 2018 at 8:33 PM, Tom Lane wrote: > Asim R P writes: > >> One can find several PageInit() calls with no content lock held. See, >> for example: > >> fill_seq_with_data() > > That would be for a relation that no one else can even see yet, no? Yes, when the sequence is being

Re: Shared buffer access rule violations?

2018-07-10 Thread Tom Lane
Asim R P writes: > In order to make changes to a shared buffer, one must hold a pin on it > and the content lock in exclusive mode. This rule seems to be > followed in most of the places but there are a few exceptions. > One can find several PageInit() calls with no content lock held. See, >

Shared buffer access rule violations?

2018-07-10 Thread Asim R P
Hi, In order to make changes to a shared buffer, one must hold a pin on it and the content lock in exclusive mode. This rule seems to be followed in most of the places but there are a few exceptions. One can find several PageInit() calls with no content lock held. See, for example: