.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH CORE 5 2017-09-15 "Linux" "Linux Programmer's Manual"
+.TH CORE 5 2019-03-06 "Linux" "Linux Programmer's Manual"
.SH NAME
core \- core dump file
.SH DESCRIPTION
is the ID of the process that dumped core,
and is created in the current working directory.
See below for details on naming.)
-Writing the core file will fail if the directory in which
+Writing the core file fails if the directory in which
it is to be created is nonwritable,
or if a file with the same name exists and
is not writable
.IR .pid ,
and such files are hidden unless one uses the
.BR ls (1)
-.I -a
+.I \-a
option.
.IP *
(Since Linux 3.7)
(The default value is thus displayed as 33.)
.PP
Memory-mapped I/O pages such as frame buffer are never dumped, and
-virtual DSO pages are always dumped, regardless of the
+virtual DSO
+.RB ( vdso (7))
+pages are always dumped, regardless of the
.I coredump_filter
value.
.PP
.BR systemd (1)
employs the
.I core_pattern
-feature that allows piping core dumps to a file.
+feature that allows piping core dumps to a program.
One can verify this by checking whether core dumps are being piped to the
-.BR systemd-coredump (8)
+.BR systemd\-coredump (8)
program:
.PP
.in +4n
.EX
$ \fBcat /proc/sys/kernel/core_pattern\fP
-|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e
+|/usr/lib/systemd/systemd\-coredump %P %u %g %s %t %c %e
.EE
.in
.PP
In this case, core dumps will be placed in the location configured for
-.BR systemd-coredump (8),
+.BR systemd\-coredump (8),
typically as
.BR lz4 (1)
compressed files in the directory
.IR /var/lib/systemd/coredump/ .
One can list the core dumps that have been recorded by
-.BR systemd-coredump (8)
+.BR systemd\-coredump (8)
using
.BR coredumpctl (1):
.PP
-.in +4n
+.in +2n
.EX
$ \fBcoredumpctl list | tail -5\fP
Wed 2017-10-11 22:25:30 CEST 2748 1000 1000 3 present /usr/bin/sleep
location into a specified file.
For example, to extract the core dump for PID 2955 shown above to a file named
.IR core
-in the current directory, one coud use:
+in the current directory, one could use:
.PP
.in +4n
.EX
-$ \fBcoredumpctl dump 2955 -o core\fP
+$ \fBcoredumpctl dump 2955 \-o core\fP
.EE
.in
.PP
.PP
.in +2n
.EX
-# echo "kernel.core_pattern=core.%p" > /etc/sysctl.d/50-coredump.conf
-# /lib/systemd/systemd-sysctl
+# echo "kernel.core_pattern=core.%p" > /etc/sysctl.d/50\-coredump.conf
+# /lib/systemd/systemd\-sysctl
.EE
.in
.PP
/* Display command\-line arguments given to core_pattern
pipe program */
- fprintf(fp, "argc=%d\\n", argc);
+ fprintf(fp, "argc=%d\en", argc);
for (j = 0; j < argc; j++)
- fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]);
+ fprintf(fp, "argc[%d]=<%s>\en", j, argv[j]);
/* Count bytes in standard input (the core dump) */
tot = 0;
while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0)
tot += nread;
- fprintf(fp, "Total bytes in core dump: %d\\n", tot);
+ fprintf(fp, "Total bytes in core dump: %d\en", tot);
fclose(fp);
exit(EXIT_SUCCESS);
.BR proc (5),
.BR pthreads (7),
.BR signal (7),
-.BR systemd-coredump (8)
+.BR systemd\-coredump (8)