xref: /freebsd/share/man/man8/crash.8 (revision 5c52a79884070364bfc920fb8e492cfac61ec72f)
1.\" FreeBSD version Copyright (c) 1996
2.\"	Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
3.\"
4.\" Adapted from share/man/man8/man8.hp300/crash.8
5.\"
6.\" Copyright (c) 1990, 1991, 1993
7.\"	The Regents of the University of California.  All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"	This product includes software developed by the University of
20.\"	California, Berkeley and its contributors.
21.\" 4. Neither the name of the University nor the names of its contributors
22.\"    may be used to endorse or promote products derived from this software
23.\"    without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35.\" SUCH DAMAGE.
36.\"
37.\" $FreeBSD$
38.\"
39.Dd February 2, 1996
40.Dt CRASH 8
41.Os
42.Sh NAME
43.Nm crash
44.Nd FreeBSD system failures
45.Sh DESCRIPTION
46This section explains a bit about system crashes
47and (very briefly) how to analyze crash dumps.
48.Pp
49When the system crashes voluntarily it prints a message of the form
50.Bl -diag -offset indent
51.It "panic: why i gave up the ghost"
52.El
53.Pp
54on the console, and if dumps have been enabled (see
55.Xr dumpon 8 ) ,
56takes a dump on a mass storage peripheral,
57and then invokes an automatic reboot procedure as
58described in
59.Xr reboot 8 .
60Unless some unexpected inconsistency is encountered in the state
61of the file systems due to hardware or software failure, the system
62will then resume multi-user operations.
63.Pp
64The system has a large number of internal consistency checks; if one
65of these fails, then it will panic with a very short message indicating
66which one failed.
67In many instances, this will be the name of the routine which detected
68the error, or a two-word description of the inconsistency.
69A full understanding of most panic messages requires perusal of the
70source code for the system.
71.Pp
72The most common cause of system failures is hardware failure, which
73can reflect itself in different ways.
74Here are the messages which
75are most likely, with some hints as to causes.
76Left unstated in all cases is the possibility that hardware or software
77error produced the message in some unexpected way.
78.Pp
79.Bl -diag -compact
80.It "cannot mount root"
81This panic message results from a failure to mount the root file system
82during the bootstrap process.
83Either the root file system has been corrupted,
84or the system is attempting to use the wrong device as root file system.
85Usually, an alternate copy of the system binary or an alternate root
86file system can be used to bring up the system to investigate.
87Most often
88this is done by the use of the boot floppy you used to install the system,
89and then using the
90.Dq fixit
91floppy.
92.Pp
93.It "init: not found"
94This is not a panic message, as reboots are likely to be futile.
95Late in the bootstrap procedure, the system was unable to locate
96and execute the initialization process,
97.Xr init 8 .
98The root file system is incorrect or has been corrupted, or the mode
99or type of
100.Pa /sbin/init
101forbids execution or is totally missing.
102.Pp
103.It "ffs_realloccg: bad optim"
104.It "ffs_valloc: dup alloc"
105.It "ffs_alloccgblk: cyl groups corrupted"
106.It "ffs_alloccg: map corrupted"
107.It "blkfree: freeing free block"
108.It "blkfree: freeing free frag"
109.It "ifree: freeing free inode"
110These panic messages are among those that may be produced
111when file system inconsistencies are detected.
112The problem generally results from a failure to repair damaged file systems
113after a crash, hardware failures, or other condition that should not
114normally occur.
115A file system check will normally correct the problem.
116.Pp
117.It "timeout table full"
118This really should not be a panic, but until the data structure
119involved is made to be extensible, running out of entries causes a crash.
120If this happens, make the timeout table bigger.
121.Pp
122.\" .It "trap type %d, code = %x, v = %x"
123.\" An unexpected trap has occurred within the system; the trap types are:
124.\" .Bl -column xxxx -offset indent
125.\" 0	bus error
126.\" 1	address error
127.\" 2	illegal instruction
128.\" 3	divide by zero
129.\" .No 4\t Em chk No instruction
130.\" .No 5\t Em trapv No instruction
131.\" 6	privileged instruction
132.\" 7	trace trap
133.\" 8	MMU fault
134.\" 9	simulated software interrupt
135.\" 10	format error
136.\" 11	FP coprocessor fault
137.\" 12	coprocessor fault
138.\" 13	simulated AST
139.\" .El
140.\" .Pp
141.\" The favorite trap type in system crashes is trap type 8,
142.\" indicating a wild reference.
143.\" ``code'' (hex) is the concatenation of the
144.\" MMU
145.\" status register
146.\" (see <hp300/cpu.h>)
147.\" in the high 16 bits and the 68020 special status word
148.\" (see the 68020 manual, page 6-17)
149.\" in the low 16.
150.\" ``v'' (hex) is the virtual address which caused the fault.
151.\" Additionally, the kernel will dump about a screenful of semi-useful
152.\" information.
153.\" ``pid'' (decimal) is the process id of the process running at the
154.\" time of the exception.
155.\" Note that if we panic in an interrupt routine,
156.\" this process may not be related to the panic.
157.\" ``ps'' (hex) is the 68020 processor status register ``ps''.
158.\" ``pc'' (hex) is the value of the program counter saved
159.\" on the hardware exception frame.
160.\" It may
161.\" .Em not
162.\" be the PC of the instruction causing the fault.
163.\" ``sfc'' and ``dfc'' (hex) are the 68020 source/destination function codes.
164.\" They should always be one.
165.\" ``p0'' and ``p1'' are the
166.\" VAX-like
167.\" region registers.
168.\" They are of the form:
169.\" .Pp
170.\" .Bd -ragged -offset indent
171.\" <length> '@' <kernel VA>
172.\" .Ed
173.\" .Pp
174.\" where both are in hex.
175.\" Following these values are a dump of the processor registers (hex).
176.\" Finally, is a dump of the stack (user/kernel) at the time of the offense.
177.\" .Pp
178.It "init died (signal #, exit #)"
179The system initialization process has exited with the specified
180signal number and exit code.
181This is bad news, as no new users will then be able to log in.
182Rebooting is the only fix, so the
183system just does it right away.
184.El
185.Pp
186That completes the list of panic types you are likely to see.
187.Pp
188If the system has been configured to take crash dumps (see
189.Xr dumpon 8 ) ,
190then when it crashes it will write (or at least attempt to write)
191an image of memory into the back end of the dump device,
192usually the same as the primary swap
193area.
194After the system is rebooted, the program
195.Xr savecore 8
196runs and preserves a copy of this core image and the current
197system in a specified directory for later perusal.
198See
199.Xr savecore 8
200for details.
201.Pp
202To analyze a dump you should begin by running
203.Xr kgdb 1
204on the system load image and core dump.
205If the core image is the result of a panic,
206the panic message is printed.
207For more details consult the chapter on kernel debugging in
208the
209.%B "FreeBSD Developers' Handbook"
210.Pq Pa http://www.FreeBSD.org/ .
211.Sh SEE ALSO
212.Xr kgdb 1 ,
213.Xr dumpon 8 ,
214.Xr reboot 8 ,
215.Xr savecore 8
216.Sh HISTORY
217The
218.Nm
219manual page first appeared in
220.Fx 2.2 .
221