]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: cache: fix "show cache" crash/skip with several caches
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Nov 2026 07:14:51 +0000 (08:14 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Nov 2026 17:20:31 +0000 (18:20 +0100)
commit171dff32dcbd3a6842055016ff3e3da0b1307b00
tree4209e30ba7e5458dc6bc6e88d8608f47dfe08d78
parent71700cabee0b7b5c9c89c7ef66e4ee4163ec5623
BUG/MEDIUM: cache: fix "show cache" crash/skip with several caches

With "show cache" cli command, a crash could be experienced when several
caches are configured. This happened when iterating on the second cache in
the list. Indded the cache tree array was not reset when the dump of a cache
was finished, leading to computing the cache tree index against the wrong
cache tree and to lock the wrong cache tree.

This is a regression introduced by the resumable CLI output.

Fix it by clearing ctx->cache_tree when the dump of a cache finishes: the
pointer must only be non-NULL while the dump is paused on the cache it
belongs to.

This patch must be backported to all supported versions.
reg-tests/cache/multi_caches_show.vtc [new file with mode: 0644]
src/cache.c