xref: /csrg-svn/share/man/man5/core.5 (revision 48832)
1*48832Scael.\" Copyright (c) 1980, 1991 Regents of the University of California.
2*48832Scael.\" All rights reserved.
320794Smckusick.\"
4*48832Scael.\" %sccs.include.redist.roff%
520794Smckusick.\"
6*48832Scael.\"     @(#)core.5	6.3 (Berkeley) 04/29/91
7*48832Scael.\"
8*48832Scael.Dd
9*48832Scael.Dt CORE 5
10*48832Scael.Os BSD 4
11*48832Scael.Sh NAME
12*48832Scael.Nm core
13*48832Scael.Nd memory image file format
14*48832Scael.Sh SYNOPSIS
15*48832Scael.Fd #include <sys/param.h>
16*48832Scael.Sh DESCRIPTION
17*48832ScaelA small number of signals which cause abnormal termination of a process
18*48832Scaelalso cause a record of the process's in-core state to be written
19*48832Scaelto disk for later examination by one of the aviailable debuggers.
20*48832Scael(See
21*48832Scael.Xr sigaction 2 . )
22*48832ScaelThis memory image is written to a file named
23*48832Scael.Nm core
24*48832Scaelin the working directory;
25*48832Scaelprovided the terminated process had write permission in the directory,
26*48832Scaeland provided the abnormality did not caused
27*48832Scaela system crash.
28*48832Scael(In this event, the decision to save the core file is arbitrary, see
29*48832Scael.Xr savecore 8 . )
30*48832Scael.Pp
3120794SmckusickThe maximum size of a
32*48832Scael.Nm core
3320794Smckusickfile is limited by
34*48832Scael.Xr setrlimit 2 .
3520794SmckusickFiles which would be larger than the limit are not created.
36*48832Scael.Pp
37*48832ScaelThe
38*48832Scael.Nm core
39*48832Scaelfile consists of the
40*48832Scael.Fa u .
4120795Smckusickarea, whose size (in pages) is
42*48832Scaeldefined by the
43*48832Scael.Dv UPAGES
44*48832Scaelmanifest in the
45*48832Scael.Aq Pa sys/param.h
4620795Smckusickfile.  The
47*48832Scael.Fa u .
4820795Smckusickarea starts with a
49*48832Scael.Fa user
5020795Smckusickstructure as given in
51*48832Scael.Aq Pa sys/user.h .
52*48832ScaelThe remainder of the
53*48832Scael.Nm core
54*48832Scaelfile consists of the data pages followed by
5520794Smckusickthe stack pages of the process image.
56*48832ScaelThe amount of data space image in the
57*48832Scael.Nm core
58*48832Scaelfile is given (in pages) by the
5920795Smckusickvariable
60*48832Scael.Fa u_dsize
6120795Smckusickin the
62*48832Scael.Fa u .
6320795Smckusickarea.
6420795SmckusickThe amount of stack image in the core file is given (in pages) by the
6520795Smckusickvariable
66*48832Scael.Fa u_ssize
6720795Smckusickin the
68*48832Scael.Ar u .
6920795Smckusickarea.
70*48832ScaelThe size of a ``page'' is given by the constant
71*48832Scael.Dv NBPG
7226515Skarels(also from
73*48832Scael.Aq Pa sys/param.h ) .
74*48832Scael.Sh SEE ALSO
75*48832Scael.Xr adb 1 ,
76*48832Scael.Xr dbx 1 ,
77*48832Scael.Xr gdb 1 ,
78*48832Scael.Xr kgdb 1 ,
79*48832Scael.Xr sigaction 2 ,
80*48832Scael.Xr setrlimit 2
81*48832Scael.Sh HISTORY
82*48832ScaelA
83*48832Scael.Nm
84*48832Scaelfile format appeared in
85*48832Scael.At v6 .
86