]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: proxy: fix crash with stop_proxy() called during init
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 8 Sep 2025 09:01:02 +0000 (11:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Sep 2025 11:38:38 +0000 (13:38 +0200)
commit9272b8ce7404942f7af563983694937a5e6b7c55
tree1bc6d83edc8ec6e316e136e4cffaf3e47eb05d0c
parent6f9fccec1f228eff392a86bfbb4383ae2464aa1b
BUG/MEDIUM: proxy: fix crash with stop_proxy() called during init

Willy reported that the following config would segfault right after the
"removing incomplete section 'peer' is emitted:

  peers peers
bind :2300
   server n10 127.0.0.1:2310

  listen dummy
  bind localhost:9999

This is caused by the fact that stop_proxy(), which tries to read shared
counters, is called during early init while shared counters are not yet
initialized. To fix the crash, let's check if we're still during starting
phase, in which case we assume the counters are not initialized and we
assume 0 value instead.

No backport needed unless 16eb0fab31 ("MAJOR: counters: dispatch counters
over thread groups") is.
src/proxy.c