I suggest your recompile without compiler optimizations, by adding the following CFLAGS directive to your make line when recompiling:
make clean && \
make TARGET=[... however your compiled previously] \
CFLAGS="-O0 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-old-style-declaration -Wno-ignored-qualifiers -Wno-clobbered -Wno-missing-field-initializers -Wtype-limits"
In the haproxy output you should then see CFLAGS begin with -O0
instead of -O2
(the rest should be the same).
Then, instead of starting haproxy via systemd or initd, start it manually and after setting the core file size to unlimited:
# whoami
root
# ulimit -c unlimited
# haproxy -f /etc/haproxy/haproxy
When haproxy crashes, you will have a corefile in the working directory. You can either run it through gdb yourself:
gdb haproxy core
(gdb)$ bt full
Or send the haproxy executable and the corefile in a tar to me (can provide private upload instructions via private message). Notice that the corefile will contain private data such as SSL keys, IP addresses hostnames and even parts of the transactions.