Segfault shortly after start with a mode log backend server udp@... and check without port; haproxy -c accepts the configuration · Issue #3528 · haproxy/haproxy · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Segfault shortly after start with a mode log backend server udp@... and check without port; haproxy -c accepts the configuration #3528
: with check (and no port on the check) passes haproxy -c, then the process crashes with SIGSEGV about two seconds after start. The timing did not change with inter 60s or with timeout connect 5s.
The same configuration runs normally with check port 18515 instead of check, and without check. HAProxy printed nothing before the crash.
Expected Behavior
Either the check uses the server's port, or the configuration is refused at parse time (and by haproxy -c) with a message saying the check needs a port. A configuration that validates should not crash the process.
Steps to Reproduce the Behavior
Save the configuration below as crash.cfg.
haproxy -c -f crash.cfg - exits 0.
haproxy -f crash.cfg -db - segfaults after about two seconds (exit 139).
Change check to check port 18515 - the process runs.
Ok found it. In fact the checks code correctly uses the implicit sv->svc_port from the server. However, we don't support UDP (ICMP) checks, and when port is mentioned on a server line, it automatically converts the check address into stream family to trigger a TCP check, while when port is missing, tcp check code uses the raw server address (here it is datagram family) and lower layers either raise a socket error when trying to connect or may segfault as you've seen since it is not expected to use a datagram family socket with TCP oriented API.
I don't know how to properly address this. Either we force haproxy checks to always enforce stream mode for log backends, or we warn the user that we don't support UDP checks so the use of port is mandatory to configure explicit TCP check?
Activity
Darlelet commentedon Oct 9, 2026
Hi
many thanks for the report and the reproducer!
Depending on the operating system, it may not crash but report a socket error instead:
It looks like haproxy is trying to perform the check without using the (implicit) port from the server. I'll take a look
Darlelet commentedon Oct 9, 2026
Ok found it. In fact the checks code correctly uses the implicit sv->svc_port from the server. However, we don't support UDP (ICMP) checks, and when
portis mentioned on a server line, it automatically converts the check address into stream family to trigger a TCP check, while whenportis missing, tcp check code uses the raw server address (here it is datagram family) and lower layers either raise a socket error when trying to connect or may segfault as you've seen since it is not expected to use a datagram family socket with TCP oriented API.I don't know how to properly address this. Either we force haproxy checks to always enforce stream mode for log backends, or we warn the user that we don't support UDP checks so the use of
portis mandatory to configure explicit TCP check?