]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: stick-table: don't deinit the buckets of a never initialized table
authorBruno Henc <hencb@protonmail.com>
Thu, 5 Nov 2026 06:28:06 +0000 (07:28 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Nov 2026 14:13:38 +0000 (15:13 +0100)
commit0bf03d5d689d770b9f320b509dbfd39836518e85
tree23beb66a904dc0ee1dbe90ace224270b4b4725b7
parent82863c6b19b59c5b6ee1a432bc542948f4e4d4f7
BUG/MINOR: stick-table: don't deinit the buckets of a never initialized table

stktable_init() is skipped for the table of a disabled proxy, so its
buckets' in_bucket_toadd lists are never initialized. stktable_deinit()
still calls MT_LIST_DELETE() on them when the proxy is freed, and
mt_list_delete() dereferences their NULL pointers. As a result, a config
with a disabled backend declaring a stick-table segfaults at the end of
"haproxy -c" (exit 139) and on every graceful stop, so on every reload.

Only walk the buckets once the table was initialized, which t->pool
tells. The rest of the function is already safe on a never initialized
table.

This was introduced with the per-bucket expiration tasks in commit
8bc8a21b2 ("MEDIUM: stick-tables: Use a per-shard expiration task"),
3.3-dev11, so it must be backported to 3.3.

It should fix the issue #3581.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/stick_table.c