]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: errors: reset diagnostic buffers after thread cleanup
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 13 Oct 2026 14:13:03 +0000 (14:13 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 29 Oct 2026 17:43:04 +0000 (17:43 +0000)
commite5e52e33c9ecdccfd1f5973607d80cc33065c0da
tree77c293b091bd03444c3e00d4e43558210f1d58a1
parente596dcdca89c04cd8ed53d4f8c4004aa824fb3b2
BUG/MINOR: errors: reset diagnostic buffers after thread cleanup

A live worker frees its thread-local diagnostic buffers before EXTRA_OBJS
teardown, whose deinitializers can still emit diagnostics.

ha_free() releases the allocation and clears only the area pointer. It
leaves size, head and data unchanged, while b_is_null() tests size rather
than area. A previously allocated buffer therefore still looks allocated
with a NULL area. Later diagnostics skip lazy allocation and can crash
when accessing the buffer.

Reset both usermsgs_buf and usermsgs_ctx.str to BUF_NULL after freeing
their areas. This clears the stale size and contents metadata so later
diagnostics can allocate fresh buffers. The post-deinit cleanup releases
any buffers reallocated during EXTRA_OBJS teardown.

This could be backported in every maintained versions.
src/errors.c