Re: memory-related bugs - Mailing list pgsql-hackers

From Noah Misch
Subject Re: memory-related bugs
Date
Msg-id 20110313090949.GA29508@tornado.gateway.2wire.net
Whole thread Raw
In response to Re: memory-related bugs  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
On Sat, Mar 12, 2011 at 04:08:23PM +0000, Greg Stark wrote:
> On Sat, Mar 12, 2011 at 1:32 PM, Noah Misch <noah@leadboat.com> wrote:
> > A suitably-instrumented run of "make installcheck-world" under valgrind turned
> > up a handful of memory-related bugs:
> 
> 
> Nice work. How did you instrument things so valgrind knew about palloc
> et al? I remember trying this in the past and running into problems.

I peppered aset.c and mcxt.c with various calls to the valgrind hook macros.  I
believe the set of hooks has grown recently (I use valgrind 3.6.0), so it may be
that the right facilities didn't exist at that time.

> I
> think the biggest one was that we write out structs to disk including
> padding so trigger lots of reads of uninitialized data warnings.

I used suppressions for call sites that write WAL or pgstat structures.  Tuples
are, with limited exceptions, fully-initialized, so I did validate those.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Collations versus user-defined functions
Next
From: Noah Misch
Date:
Subject: Re: memory-related bugs