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*65101Smckusick.\" @(#)core.5 8.3 (Berkeley) 12/11/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 19*65101Smckusickto disk for later examination by one of the available debuggers. 2048832Scael(See 2148832Scael.Xr sigaction 2 . ) 2248832ScaelThis memory image is written to a file named 2364913Smckusick.Nm programname.core 2448832Scaelin the working directory; 2548832Scaelprovided the terminated process had write permission in the directory, 26*65101Smckusickand provided the abnormality did not cause 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 3264913Smckusick.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 3864913Smckusick.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 5364913Smckusick.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 5764913Smckusick.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 8364913Smckusick.Nm core 8448832Scaelfile format appeared in 8548832Scael.At v6 . 86