기술
특정 신호의 기본 동작은 종료하고 생산하는 과정 일으킬 것입니다 코어 덤프 파일 , 종료시 프로세스의 메모리의 이미지를 포함하는 디스크 파일을. 이 이미지는 디버거 (예 : gdb (1))에서 프로그램 종료시 프로그램 상태를 검사하는 데 사용할 수 있습니다. 프로세스가 코어를 덤프하게하는 신호 목록은 signal (7)에서 찾을 수 있습니다.
...
코어 덤프 파일이 생성되지 않는 다양한 상황이 있습니다.
* The process does not have permission to write the core file. (By
default, the core file is called core or core.pid, where pid 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 it is to
be created is nonwritable, or if a file with the same name exists
and is not writable or is not a regular file (e.g., it is a
directory or a symbolic link).
* A (writable, regular) file with the same name as would be used for
the core dump already exists, but there is more than one hard link
to that file.
* The filesystem where the core dump file would be created is full;
or has run out of inodes; or is mounted read-only; or the user has
reached their quota for the filesystem.
* The directory in which the core dump file is to be created does
not exist.
* The RLIMIT_CORE (core file size) or RLIMIT_FSIZE (file size)
resource limits for the process are set to zero; see getrlimit(2)
and the documentation of the shell's ulimit command (limit in
csh(1)).
* The binary being executed by the process does not have read
permission enabled.
* The process is executing a set-user-ID (set-group-ID) program that
is owned by a user (group) other than the real user (group) ID of
the process, or the process is executing a program that has file
capabilities (see capabilities(7)). (However, see the description
of the prctl(2) PR_SET_DUMPABLE operation, and the description of
the /proc/sys/fs/suid_dumpable file in proc(5).)
* (Since Linux 3.7) The kernel was configured without the
CONFIG_COREDUMP option.
또한 madvise (2) MADV_DONTDUMP 플래그가 사용 된 경우 코어 덤프는 프로세스 주소 공간의 일부를 제외 할 수 있습니다.
코어 덤프 파일 이름 지정
기본적으로 코어 덤프 파일의 이름은 core이지만 / proc / sys / kernel / core_pattern 파일 (Linux 2.6 및 2.4.21부터)은 코어 덤프 파일의 이름을 지정하는 데 사용되는 템플릿을 정의하도록 설정할 수 있습니다. 템플리트에는 코어 파일이 작성 될 때 다음 값으로 대체되는 % 지정자가 포함될 수 있습니다.
%% 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
gdb path-to-your-binary path-to-corefile
그info stack
뒤에옵니다Ctrl-d
. 걱정되는 것은 코어 덤핑이 일반적인 것입니다.