From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Getting better results from valgrind leak tracking
Date: Wed, 17 Mar 2021 00:01:55 -0400
Message-ID: <3482163.1615953715@sss.pgh.pa.us> (raw)
In-Reply-To: <cea52c41-f005-4ec3-8dd8-4d12dbfbe9f6@www.fastmail.com>
References: <3471359.1615937770@sss.pgh.pa.us>
<20210317023101.anvejcfotwka6gaa@alap3.anarazel.de>
<3479700.1615950107@sss.pgh.pa.us>
<cea52c41-f005-4ec3-8dd8-4d12dbfbe9f6@www.fastmail.com>
"Andres Freund" <andres@anarazel.de> writes:
> On Tue, Mar 16, 2021, at 20:01, Tom Lane wrote:
>> That seems both unnecessary and impractical. We have to consider that
>> everything-still-reachable is an OK final state.
> I don't consider "still reachable" a leak. Just definitely unreachable.
OK, we're in violent agreement then -- I must've misread what you wrote.
>>> I think the run might have shown a genuine leak:
>> I didn't see anything like that after applying the fixes I showed before.
> I think it's actually unreachable memory (unless you count resetting the cache context), based on manually tracing the code... I'll try to repro.
I agree that having to reset CacheContext is not something we
should count as "still reachable", and I'm pretty sure that the
existing valgrind infrastructure doesn't count it that way.
As for the particular point about ParallelBlockTableScanWorkerData,
I agree with your question to David about why that's in TableScanDesc
not HeapScanDesc, but I can't get excited about it not being freed in
heap_endscan. That's mainly because I do not believe that anything as
complex as a heap or indexscan should be counted on to be zero-leakage.
The right answer is to not do such operations in long-lived contexts.
So if we're running such a thing while switched into CacheContext,
*that* is the bug, not that heap_endscan didn't free this particular
allocation.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
Subject: Re: Getting better results from valgrind leak tracking
In-Reply-To: <3482163.1615953715@sss.pgh.pa.us>
References: <3471359.1615937770@sss.pgh.pa.us> <20210317023101.anvejcfotwka6gaa@alap3.anarazel.de> <3479700.1615950107@sss.pgh.pa.us> <cea52c41-f005-4ec3-8dd8-4d12dbfbe9f6@www.fastmail.com> <3482163.1615953715@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox