]> git.ipfire.org Git - thirdparty/squid.git/commit
Annotate PoolMalloc memory in valgrind builds (#1946)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 13 Nov 2024 18:16:08 +0000 (18:16 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 13 Nov 2024 22:20:46 +0000 (22:20 +0000)
commitaacc917f47dcd9fd330729f3a28a0582bb14075d
treef5155aa5e20901a8ca320282cd115590e635a375
parent187bb5d258ebd919cae99a137bb7a511f34cffef
Annotate PoolMalloc memory in valgrind builds (#1946)

MemPoolMalloc code (i.e. memory_pools code used by default) was missing
VALGRIND_MAKE_MEM_*() calls. Similar calls do exist in MemPoolChunked
code (i.e. code enabled by setting MEMPOOLS environment variable to 1).

Even with these markings, "memory_pools on" configuration is still not
quite compatible with Valgrind leak reporting suppressions: In some
cases, Valgrind may still incorrectly suppress leak reporting (or report
leaks that should have been suppressed) because Valgrind associates leak
suppressions with memory _allocators_ while buggy code may leak memory
allocated by others. The long-term solution (if it exists) requires
upgrading these markings to VALGRIND_MEMPOOL_*() API targeting memory
pools, but that requires a serious effort, especially when dealing with
MemPoolChunked complexities. The added markings help detect non-leak
violations and improve PoolMalloc/MemPoolChunked code symmetry.
src/mem/PoolMalloc.cc