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: Suppress complaints about leaks in TS dictionary loading.
Date: Sun, 03 Aug 2025 02:00:50 +0000
Message-ID: <E1uiO1p-000SoH-32@gemulon.postgresql.org> (raw)

Suppress complaints about leaks in TS dictionary loading.

Like the situation with function cache loading, text search
dictionary loading functions tend to leak some cruft into the
dictionary's long-lived cache context.  To judge by the examples in
the core regression tests, not very many bytes are at stake.
Moreover, I don't see a way to prevent such leaks without changing the
API for TS template initialization functions: right now they do not
have to worry about making sure that their results are long-lived.

Hence, I think we should install a suppression rule rather than trying
to fix this completely.  However, I did grab some low-hanging fruit:
several places were leaking the result of get_tsearch_config_filename.
This seems worth doing mostly because they are inconsistent with other
dictionaries that were freeing it already.

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/7f6ededa764b287ba593a2bb7fd566df8053213e

Modified Files
--------------
src/backend/tsearch/dict_ispell.c    | 18 ++++++++++++------
src/backend/tsearch/dict_synonym.c   |  1 +
src/backend/tsearch/dict_thesaurus.c |  7 ++++---
src/backend/utils/cache/ts_cache.c   |  4 +++-
src/tools/valgrind.supp              | 12 ++++++++++++
5 files changed, 32 insertions(+), 10 deletions(-)



view thread (2+ messages)

Message-ID: <E1uiO1p-000SoH-32@gemulon.postgresql.org>
Permalink:  ../E1uiO1p-000SoH-32@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uiO1p-000SoH-32@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: Suppress complaints about leaks in TS dictionary loading.
  In-Reply-To: <E1uiO1p-000SoH-32@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