]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: pools: fix default pool alignment
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Oct 2025 07:01:54 +0000 (09:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Oct 2025 07:06:20 +0000 (09:06 +0200)
commitf936feb3a97d9c576a5e38671a5678225ab7997e
treea62d2b7bab6fa30b480ad2da71bfff9221bd91d6
parentbece70412810b47e5eb98eda059252bf535b2992
BUG/MAJOR: pools: fix default pool alignment

The doc in commit 977feb5617 ("DOC: api: update the pools API with the
alignment and typed declarations") says that alignment of zero means
the type's alignment. And this is followed by the DECLARE_TYPED_POOL()
macro. Yet this is not what is done in create_pool_from_reg() which
only raises the alignment to a void* if lower, while it should start
from the type's. The effect is haproxy refusing to start on some 32-bit
platforms since that commit, displaying an error such as:

   "BUG in the code: at src/mux_h2.c:454, requested creation of pool
    'h2s' aligned to 4 while type requires alignment of 8! Please
    report to developers. Aborting."

Let's just apply the default type's alignment.

Thanks to @tianon for reporting this in GH issue #3168. No backport is
needed since aligned pools are 3.3-only.
src/pool.c