pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Silence complaints about leaks in PlanCacheComputeResultDesc.
Date: Sun, 03 Aug 2025 02:00:50 +0000
Message-ID: <E1uiO1p-000SoJ-36@gemulon.postgresql.org> (raw)

Silence complaints about leaks in PlanCacheComputeResultDesc.

CompleteCachedPlan intentionally doesn't worry about small
leaks from PlanCacheComputeResultDesc.  However, Valgrind
knows nothing of engineering tradeoffs and complains anyway.
Silence it by doing things the hard way if USE_VALGRIND.

I don't really love this patch, because it makes the handling
of plansource->resultDesc different from the handling of query
dependencies and search_path just above, which likewise are willing
to accept small leaks into the cached plan's context.  However,
those cases aren't provoking Valgrind complaints.  (Perhaps in a
CLOBBER_CACHE_ALWAYS build, they would?)  For the moment, this
makes the src/pl/plpgsql tests leak-free according to Valgrind.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b102c8c4733cf76ff0635dc440ee8dd11487ed95

Modified Files
--------------
src/backend/utils/cache/plancache.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)



Message-ID: <E1uiO1p-000SoJ-36@gemulon.postgresql.org>
Permalink:  ../E1uiO1p-000SoJ-36@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uiO1p-000SoJ-36@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Silence complaints about leaks in PlanCacheComputeResultDesc.
  In-Reply-To: <E1uiO1p-000SoJ-36@gemulon.postgresql.org>

* 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