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

From Tom Lane
Subject Re: valgrind a background worker
Date
Msg-id 86420.1676058981@sss.pgh.pa.us
Whole thread Raw
In response to Re: valgrind a background worker  (Jon Erdman <jon@thewickedtribe.net>)
List pgsql-general
=?UTF-8?Q?Jon_Erdman?= <jon@thewickedtribe.net> writes:
> I’m suspecting that the leak might be coming from initStringInfo(), as I see a palloc() in there and no associated
pfree()in my background worker’s code, but looking at the elog backend code, it looks like maybe you only have to
explicitlyfree buf if you relocate it larger? 

Usually it's more like "you need to pfree if you allocated in a long-lived
memory context".  elog is working in ErrorContext which it expects will
be reset when the dust settles.

            regards, tom lane



pgsql-general by date:

Previous
From: "Lawrence, Mike (DTST)"
Date:
Subject: RE: PostgreSQL 13.9.3 Uninstall fails with "Unable to initialize any installation mode"
Next
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL 13.9.3 Uninstall fails with "Unable to initialize any installation mode"