Add autoconf option to enable memory leak detection in libraries

There's a known memory leak in the engine_pkcs11 at the time of writing
this and it interferes with the named ability to check for memory leaks
in the OpenSSL memory context by default.

Add an autoconf option to explicitly enable the memory leak detection,
and use it in the CI except for pkcs11 enabled builds.  When this gets
fixed in the engine_pkc11, the option can be enabled by default.
This commit is contained in:
Ondřej Surý
2022-09-27 13:35:26 +02:00
parent d1cc847ab0
commit 3b31f7f563
6 changed files with 33 additions and 4 deletions

View File

@@ -580,6 +580,19 @@ loops.
None of these allocation functions, including `isc_mempool_get()`, can
fail. If no memory is available for allocation, the program will abort.
The memory context can be set to check if all memory allocated via the said
memory context was freed before the memory context was destroyed by calling
`isc_mem_checkdestroyed()`. This could lead to false positives on abnormal
shutdowns, so the checking is only enabled in `dig` and `named` applications on
normal shutdown.
The memory context are normally used only for internal allocations, but several
external libraries allow replacing their allocators (namely libxml2, libuv and
OpenSSL). As there has been known memory leak in the OpenSSL when
`engine_pkcs11` is loaded, memory checking at destroy is disabled by default in
the memory contexts used for external libraries and it needs to be enabled with
a `--enable-leak-detection` autoconf option.
#### <a name="lists"></a>Lists
A set of macros are provided for creating, modifying and iterating