memory image file format
A small number of signals which cause abnormal termination of a process also
cause a record of the process's in-core state to be written to disk for later
examination by one of the available debuggers. (See
This memory image is written to a file named by default
in the working directory;
provided the terminated process had write permission in the directory, and
provided the abnormality did not cause a system crash. (In this event, the
decision to save the core file is arbitrary, see
The maximum size of a core file is limited by
Files which would be larger than the limit are not created.
The name of the file is controlled via the
. The contents of this
variable describes a filename to store the core image to. This filename can be
absolute, or relative (which will resolve to the current working directory of
the program generating it).
The following format specifiers may be used in the
sysctl to insert additional
information into the resulting core filename:
- Machine hostname.
- An index starting at zero until the sysctl
debug.ncores is reached. This can be useful
for limiting the number of corefiles generated by a particular
- process name.
- processes PID.
- process UID.
The name defaults to %N.core
, yielding the
By default, a process that changes user or group credentials whether real or
effective will not create a corefile. This behaviour can be changed to
generate a core dump by setting the
Corefiles can be compressed by the kernel if the following item is included in
the kernel configuration file:
The following sysctl control core file compression:
- Enable compression of user cores. A value of 1 configures
compression, and a value of 2 configures
compression. Compressed core files will have a suffix of
.zst’ appended to their filenames
depending on the selected format.
- Compression level. Defaults to 6.
Corefiles are written with open file descriptor information as an ELF note. By
default, file paths are packed to only use as much space as needed. However,
file paths can change at any time, including during core dump, and this can
result in truncated file descriptor data.
All file descriptor information can be preserved by disabling packing. This
potentially wastes up to PATH_MAX bytes per open fd. Packing is disabled with
Similarly, corefiles are written with vmmap information as an ELF note, which
contains file paths. By default, they are packed to only use as much space as
needed. By the same mechanism as for the open files note, these paths can also
change at any time and result in a truncated note.
All vmmap information can be preserved by disabling packing. Like the file
information, this potentially wastes up to PATH_MAX bytes per mapped object.
Packing is disabled with
In order to store all core images in per-user private areas under
, the following
command can be used:
file format appeared in
Version 6 AT&T UNIX