Re: valgrind a background worker - Mailing list pgsql-general

From Jeffrey Walton
Subject Re: valgrind a background worker
Date
Msg-id CAH8yC8kzfRCW_Q+mWAG-+eMNr0piLwXFg76eHDNupzndN3g=uw@mail.gmail.com
Whole thread Raw
In response to Re: valgrind a background worker  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: valgrind a background worker  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Feb 10, 2023 at 10:04 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> =?UTF-8?Q?Jon_Erdman?= <jon@thewickedtribe.net> writes:
> > I've got a background worker that has a slow memory leak in it
> > somewhere. How can I get it to start under valgrind to get a memcheck
> > output from it?
>
> You have to valgrind the whole cluster AFAIK.  Basically, start
> the postmaster under valgrind with --trace-children=yes.
> For leak tracking you probably also want
> --leak-check=full --track-origins=yes --read-var-info=yes

One additional comment... the program in question and PostgreSQL
should also be built with -g -O1 per
https://valgrind.org/docs/manual/quick-start.html . Otherwise, there's
a risk the line information will not be accurate or usable.

Jeff



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL 13.9.3 Uninstall fails with "Unable to initialize any installation mode"
Next
From: Tom Lane
Date:
Subject: Re: valgrind a background worker