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