Re: Valgrind Memcheck support - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Valgrind Memcheck support
Date
Msg-id 20130911213609.GH1138556@alap2.anarazel.de
Whole thread Raw
In response to Re: Valgrind Memcheck support  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On 2013-09-06 21:55:09 +0100, Greg Stark wrote:
> On Sun, Jun 9, 2013 at 10:25 PM, Noah Misch <noah@leadboat.com> wrote:
> 
> > - Test recovery, such as by running a streaming replica under Memcheck
> > while
> >   the primary runs "make installcheck-world".
> >
> 
> In general we need a lot more testing on the recovery code.
> 
> 
> >  - Memcheck has support for detecting leaks.  I have not explored that
> > side at
> >   all, always passing --leak-check=no.  We could add support for freeing
> >   "everything" at process exit, thereby making the leak detection
> > meaningful.
> >
> 
> I think this is missing the type of leaks we actually care about. The way
> palloc works we can be virtually certain that if we did that we wouldn't
> have any leaks. All it would detect are the random one-off mallocs we know
> very well are there.

Well, we do have a good number of things that allocate stuff in
TopMemoryContext. So it might already catch leaks into that. IIRC we
don't reset that, but even if, that can easily be removed.
Valgrind's detection for "unreachable memory" is nice for that.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Next
From: Kevin Grittner
Date:
Subject: citext tests "with and without index" had no index