]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: ring: free the ring storage not the ring itself when using maps
authorWilly Tarreau <w@1wt.eu>
Tue, 26 Mar 2024 14:12:19 +0000 (15:12 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Mar 2024 14:15:59 +0000 (15:15 +0100)
commit40d1c84bf0276137b8b08f4305b8c52e083e1d58
tree8723bb6f824f975bcbaab0dd50c8a3ce5b3b0983
parentbd98db50785b6cef946d38715b48f72e7ca73a59
BUG/MAJOR: ring: free the ring storage not the ring itself when using maps

A recent issue was uncovered by the CI which started to randomly report
segfaults on a few tests, and more systematically on FreeBSD. It turn
out that it was introduced by recent commit 03816ccfa9 ("MAJOR: ring:
insert an intermediary ring_storage level"), which overlooked the munmap()
path of the sink and startup logs: once the ring and its storage were
split, it was no longer correct to munmap() the ring, only its storage
area needs to be unmapped, and the ring must always be freed separately.

Thanks to Christopher and William for their help at trying to reproduce
it and figure the circumstances that triggers it.

No backport is needed.
src/errors.c
src/sink.c