If the project policy is to ignore leaks in short-lived binaries, why
are those known cases not listed explicitly in an LSan suppression file
(for example, see attached patch)?
Disabling leak detection globally with detect_leaks=0 also hides leaks
that may be relevant in long-running processes. Explicit suppressions
would document the intentionally ignored cases while preserving LSan
coverage for the rest of the code.
Regards,
Ivan
On 26-07-22 01:38, Michael Paquier wrote:
None of the changes proposed in the patch are worth caring about. The
only memory leaks I would care about in the frontend binaries are
those where we could run a tool in an infinite loop where the
non-freed would bloat. One example of that is pg_receivewal without
--no-loop, that could be used as a service to get WAL from a remote
source.
--
Michael
--
Best wishes,
Ivan Kush
Tantor Labs LLC
From a65eefc5aa4915351bddf835f0713ce84f7ec859 Mon Sep 17 00:00:00 2001
From: Ivan Kush <[email protected]>
Date: Wed, 22 Jul 2026 10:15:00 +0300
Subject: [PATCH] Add LeakSanitizer suppression for pg_config
pg_config is a short-lived frontend binary and intentionally relies on
process termination to release its allocations.
Add an LSan suppression matching the binary name, and enable leak
detection for the address-sanitizer CI job.
---
.github/workflows/pg-ci.yml | 5 +++--
src/tools/ci/lsan.supp | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
create mode 100644 src/tools/ci/lsan.supp
diff --git a/.github/workflows/pg-ci.yml b/.github/workflows/pg-ci.yml
index a2629c8..66f5a95 100644
--- a/.github/workflows/pg-ci.yml
+++ b/.github/workflows/pg-ci.yml
@@ -464,9 +464,10 @@ jobs:
# Configure sanitizer runtime behavior to be suitable for running tests:
# disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
# print_stacktraces=1,verbosity=2, duh
- # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
+ # detect_leaks=1: report leaks except those listed in the suppression file
UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
- ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
+ ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=1
+ LSAN_OPTIONS: suppressions=${{ github.workspace }}/src/tools/ci/lsan.supp
steps:
# GitHub Actions does not make it easy to share some, but not all,
diff --git a/src/tools/ci/lsan.supp b/src/tools/ci/lsan.supp
new file mode 100644
index 0000000..063250d
--- /dev/null
+++ b/src/tools/ci/lsan.supp
@@ -0,0 +1,3 @@
+# pg_config is a short-lived frontend program. Its allocations are released
+# by the operating system when the process exits.
+leak:pg_config
--
2.47.3