]> git.ipfire.org Git - thirdparty/systemd.git/commit
coredump: add COREDUMP_CODE field for signal reason 42019/head
authorEmanuele Rocca <emanuele.rocca@arm.com>
Wed, 6 May 2026 15:46:21 +0000 (15:46 +0000)
committerEmanuele Rocca <emanuele.rocca@arm.com>
Tue, 19 May 2026 08:28:53 +0000 (08:28 +0000)
commited143d8623086ebc835679c7f29ae3ff7a69cde3
tree06c68d2ec88c02a9a32da5393b08d6b4a0b8e3c2
parentc8c1bcf1941047d1fe43d9827ad4826b4620297a
coredump: add COREDUMP_CODE field for signal reason

Introduce COREDUMP_CODE as a new captured field alongside the existing
COREDUMP_SIGNAL. While COREDUMP_SIGNAL identifies the signal number that
terminated the process, COREDUMP_CODE provides the reason the signal was sent.

For example, a process terminated by SIGSEGV due to invalid permissions would
produce COREDUMP_SIGNAL=11 and COREDUMP_CODE=2 (SEGV_ACCERR).

The kernel exposes coredump_code via pidfd starting with v7.1:
https://git.kernel.org/torvalds/c/701f7f4fbabbf4989ba6fbf033b160dd943221d5

System administrators can find both the signal and code in coredumpctl info:

$ coredumpctl info | grep Signal:
        Signal: 11 (SEGV) si_code: SEGV_MAPERR

Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
man/systemd-coredump.xml
src/coredump/coredump-context.c
src/coredump/coredump-context.h
src/coredump/coredumpctl.c
test/units/TEST-87-AUX-UTILS-VM.coredump.sh