Table of Contents

Overview

Details of core files related to systemd-coredump.

External pages:

File list

Coredump configuration

/usr/lib/sysctl.d/50-coredump.conf:

kernel.core_pattern=|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e

/proc/sys/kernel/core_pattern:

|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e

Configuring the core dump

core dump variables

%%  a single % character
%c  core file size soft resource limit of  crashing  process  (since  Linux 2.6.24)
%d  dump  mode—same  as  value  returned by prctl(2) PR_GET_DUMPABLE (since Linux 3.7)
%e  executable filename (without path prefix)
%E  pathname of executable, with  slashes  ('/')  replaced  by  exclamation marks ('!') (since Linux 3.0).
%g  (numeric) real GID of dumped process
%h  hostname (same as nodename returned by uname(2))
%i  TID of thread that triggered core dump, as seen in the PID namespace in which the thread resides (since Linux 3.18)
%I  TID of thread that triggered core dump, as  seen  in  the  initial  PID namespace (since Linux 3.18)
%p  PID  of  dumped  process,  as  seen  in  the PID namespace in which the process resides
%P  PID of dumped process, as seen in  the  initial  PID  namespace  (since Linux 3.12)
%s  number of signal causing dump
%t  time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
%u  (numeric) real UID of dumped process

Piping to a program

Rules

/proc/sys/kernel/core_pipe_limit

When collecting core dumps via a pipe to a user-space program, it can be useful for the collecting program to gather data about the crashing process from that process's /proc/[pid] directory. In order to do this safely, the kernel must wait for the program collecting the core dump to exit, so as not to remove the crashing process's /proc/[pid] files prematurely. This in turn creates the possibility that a misbehaving collecting program can block the reaping of a crashed process by simply never exiting.

Since Linux 2.6.32, the /proc/sys/kernel/core_pipe_limit can be used to defend against this possibility. The value in this file defines how many concurrent crashing processes may be piped to user-space programs in parallel. If this value is exceeded, then those crashing processes above this value are noted in the kernel log and their core dumps are skipped.

A value of 0 in this file is special. It indicates that unlimited processes may be captured in parallel, but that no waiting will take place (i.e., the collecting program is not guaranteed access to /proc/<crashing-PID>). The default value for this file is 0.