Re: [PATCH] Fix memory leak in pg_config

Поиск
Список
Период
Сортировка
Искать

Re: [PATCH] Fix memory leak in pg_config

От:
Ivan Kush <ivan.kush@tantorlabs.com>
Дата:
Вложения:
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

Re: [PATCH] Fix memory leak in pg_config

От:
Andres Freund <andres@anarazel.de>
Дата:
Вложения:
Hi,

On 2026-07-22 14:54:17 +0300, Ivan Kush wrote:
> 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.

Because we so far have not been using lsan. It might be worth supporting it,
but we haven't so far. You'd have to make a case for doing that on its own.

For the server lsan is probably not very helpful. Just about all allocations
in the backend are done via memory contexts, which lsan does not understand -
and can't easily be made to be understand, IIRC. Whereas we made valgrind
mostly understand memory contexts.

Greetings,

Andres Freund


FAQ