BUG/MEDIUM: connection: fix pool free regression with recent ppv2 TLV patches
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Sep 2023 09:45:37 +0000 (11:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Sep 2023 09:45:37 +0000 (11:45 +0200)
commit135c66f6cb34a993df544e7da72e323d058ac54d
tree5f514afea4844df5512efc34471ad13541db293d
parentd52466726fec5d9eb97ab1aa1c94e02d40767f43
BUG/MEDIUM: connection: fix pool free regression with recent ppv2 TLV patches

In commit fecc573da ("MEDIUM: connection: Generic, list-based allocation
and look-up of PPv2 TLVs") there was a tiny mistake, elements of length
<= 128 are allocated from pool_pp_128 but only those of length < 128 are
released to this pool, other ones go to pool_pp_256. Because of this,
elements of size exactly 128 are allocated from 128 and released to 256.
It can be reproduced a few times by running sample_fetches/tlvs.vtc 1000
times with -DDEBUG_DONT_SHARE_POOLS -DDEBUG_MEMORY_POOLS -DDEBUG_EXPR
-DDEBUG_STRICT=2 -DDEBUG_POOL_INTEGRITY -DDEBUG_POOL_TRACING
-DDEBUG_NO_POOLS. Not sure why it doesn't reproduce more often though.

No backport is needed. This should address github issues #2275 and #2274.
src/connection.c