xref: /csrg-svn/share/man/man5/core.5 (revision 64913)
161609Sbostic.\" Copyright (c) 1980, 1991, 1993
261609Sbostic.\"	The Regents of the University of California.  All rights reserved.
320794Smckusick.\"
448832Scael.\" %sccs.include.redist.roff%
520794Smckusick.\"
6*64913Smckusick.\"     @(#)core.5	8.2 (Berkeley) 11/17/93
748832Scael.\"
848832Scael.Dd
948832Scael.Dt CORE 5
1048832Scael.Os BSD 4
1148832Scael.Sh NAME
1248832Scael.Nm core
1348832Scael.Nd memory image file format
1448832Scael.Sh SYNOPSIS
1548832Scael.Fd #include <sys/param.h>
1648832Scael.Sh DESCRIPTION
1748832ScaelA small number of signals which cause abnormal termination of a process
1848832Scaelalso cause a record of the process's in-core state to be written
1948832Scaelto disk for later examination by one of the aviailable debuggers.
2048832Scael(See
2148832Scael.Xr sigaction 2 . )
2248832ScaelThis memory image is written to a file named
23*64913Smckusick.Nm programname.core
2448832Scaelin the working directory;
2548832Scaelprovided the terminated process had write permission in the directory,
2648832Scaeland provided the abnormality did not caused
2748832Scaela system crash.
2848832Scael(In this event, the decision to save the core file is arbitrary, see
2948832Scael.Xr savecore 8 . )
3048832Scael.Pp
3120794SmckusickThe maximum size of a
32*64913Smckusick.Nm programname.core
3320794Smckusickfile is limited by
3448832Scael.Xr setrlimit 2 .
3520794SmckusickFiles which would be larger than the limit are not created.
3648832Scael.Pp
3748832ScaelThe
38*64913Smckusick.Nm programname.core
3948832Scaelfile consists of the
4048832Scael.Fa u .
4120795Smckusickarea, whose size (in pages) is
4248832Scaeldefined by the
4348832Scael.Dv UPAGES
4448832Scaelmanifest in the
4548832Scael.Aq Pa sys/param.h
4620795Smckusickfile.  The
4748832Scael.Fa u .
4820795Smckusickarea starts with a
4948832Scael.Fa user
5020795Smckusickstructure as given in
5148832Scael.Aq Pa sys/user.h .
5248832ScaelThe remainder of the
53*64913Smckusick.Nm programname.core
5448832Scaelfile consists of the data pages followed by
5520794Smckusickthe stack pages of the process image.
5648832ScaelThe amount of data space image in the
57*64913Smckusick.Nm programname.core
5848832Scaelfile is given (in pages) by the
5920795Smckusickvariable
6048832Scael.Fa u_dsize
6120795Smckusickin the
6248832Scael.Fa u .
6320795Smckusickarea.
6420795SmckusickThe amount of stack image in the core file is given (in pages) by the
6520795Smckusickvariable
6648832Scael.Fa u_ssize
6720795Smckusickin the
6848832Scael.Ar u .
6920795Smckusickarea.
7048832ScaelThe size of a ``page'' is given by the constant
7148832Scael.Dv NBPG
7226515Skarels(also from
7348832Scael.Aq Pa sys/param.h ) .
7448832Scael.Sh SEE ALSO
7548832Scael.Xr adb 1 ,
7648832Scael.Xr dbx 1 ,
7748832Scael.Xr gdb 1 ,
7848832Scael.Xr kgdb 1 ,
7948832Scael.Xr sigaction 2 ,
8048832Scael.Xr setrlimit 2
8148832Scael.Sh HISTORY
8248832ScaelA
83*64913Smckusick.Nm core
8448832Scaelfile format appeared in
8548832Scael.At v6 .
86