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