]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: read all libs in memory when set-dumpable=libs
authorWilly Tarreau <w@1wt.eu>
Wed, 18 Mar 2026 09:47:16 +0000 (10:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 Mar 2026 14:30:39 +0000 (15:30 +0100)
commite1738b665d72b88237c76a48f416b47b50e8c2d3
treedb4c49c17e4e96f2b12e68e09f1fc3ca8e16327d
parent6152a4eef51418bc1ed0b90f0ce652440c876917
MINOR: debug: read all libs in memory when set-dumpable=libs

When "set-dumpable" is set to "libs", in addition to marking the process
dumpable, haproxy also reads the binary and shared objects into memory as
a tar archive in a page-aligned location so that these files are easily
extractable from a future core dump. The goal here is to always have
access to the exact same binary and libs as those which caused the core
to happen. It's indeed very frequent to miss some of these, or to get
mismatching files due to a local update that didn't experience a reload,
or to get those of a host system instead of the container.

The in-memory tar file presents everything under a directory called
"core-%d" where %d corresponds to the PID of the worker process. In
order to ease the finding of these data in the core dump, the memory
area is contiguous and surrounded by PROT_NONE pages so that it appears
in its own segment in the core file. The total size used by this is a
few tens of MB, which is not a problem on large systems.
doc/configuration.txt
include/haproxy/global-t.h
include/haproxy/global.h
include/haproxy/tools.h
src/cfgparse-global.c
src/haproxy.c
src/tools.c