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 25, 2025 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 Mounting from <device> failed with error <err> 75The system was unable to mount the configured root filesystem. 76Either the root filesystem has been corrupted, 77or the system is attempting to use the wrong device as root filesystem. 78.Pp 79This is not a panic message; rather it is followed by an interactive 80.Sy mountroot> 81prompt where the operator can list detected devices and filesystems, 82and select an alternative root filesystem to mount. 83Alternatively, the system can be booted from recovery media to repair 84the situation. 85The system install media provides a live environment which is suitable 86for this task. 87.Pp 88.It "init: not found" 89This is not a panic message, as reboots are likely to be futile. 90Late in the bootstrap procedure, the system was unable to locate 91and execute the initialization process, 92.Xr init 8 . 93The root file system is incorrect or has been corrupted, or the mode 94or type of 95.Pa /sbin/init 96forbids execution or is totally missing. 97.Pp 98.It "ffs_realloccg: bad optim" 99.It "ffs_valloc: dup alloc" 100.It "ffs_alloccgblk: cyl groups corrupted" 101.It "ffs_alloccg: map corrupted" 102.It "blkfree: freeing free block" 103.It "blkfree: freeing free frag" 104.It "ifree: freeing free inode" 105These panic messages are among those that may be produced 106when file system inconsistencies are detected. 107The problem generally results from a failure to repair damaged file systems 108after a crash, hardware failures, or other condition that should not 109normally occur. 110A file system check will normally correct the problem. 111.Pp 112.\" .It "trap type %d, code = %x, v = %x" 113.\" An unexpected trap has occurred within the system; the trap types are: 114.\" .Bl -column xxxx -offset indent 115.\" 0 bus error 116.\" 1 address error 117.\" 2 illegal instruction 118.\" 3 divide by zero 119.\" .No 4\t Em chk No instruction 120.\" .No 5\t Em trapv No instruction 121.\" 6 privileged instruction 122.\" 7 trace trap 123.\" 8 MMU fault 124.\" 9 simulated software interrupt 125.\" 10 format error 126.\" 11 FP coprocessor fault 127.\" 12 coprocessor fault 128.\" 13 simulated AST 129.\" .El 130.\" .Pp 131.\" The favorite trap type in system crashes is trap type 8, 132.\" indicating a wild reference. 133.\" ``code'' (hex) is the concatenation of the 134.\" MMU 135.\" status register 136.\" (see <hp300/cpu.h>) 137.\" in the high 16 bits and the 68020 special status word 138.\" (see the 68020 manual, page 6-17) 139.\" in the low 16. 140.\" ``v'' (hex) is the virtual address which caused the fault. 141.\" Additionally, the kernel will dump about a screenful of semi-useful 142.\" information. 143.\" ``pid'' (decimal) is the process id of the process running at the 144.\" time of the exception. 145.\" Note that if we panic in an interrupt routine, 146.\" this process may not be related to the panic. 147.\" ``ps'' (hex) is the 68020 processor status register ``ps''. 148.\" ``pc'' (hex) is the value of the program counter saved 149.\" on the hardware exception frame. 150.\" It may 151.\" .Em not 152.\" be the PC of the instruction causing the fault. 153.\" ``sfc'' and ``dfc'' (hex) are the 68020 source/destination function codes. 154.\" They should always be one. 155.\" ``p0'' and ``p1'' are the 156.\" VAX-like 157.\" region registers. 158.\" They are of the form: 159.\" .Pp 160.\" .Bd -ragged -offset indent 161.\" <length> '@' <kernel VA> 162.\" .Ed 163.\" .Pp 164.\" where both are in hex. 165.\" Following these values are a dump of the processor registers (hex). 166.\" Finally, is a dump of the stack (user/kernel) at the time of the offense. 167.\" .Pp 168.It "init died (signal #, exit #)" 169The system initialization process has exited with the specified 170signal number and exit code. 171This is bad news, as no new users will then be able to log in. 172Rebooting is the only fix, so the 173system just does it right away. 174.El 175.Pp 176That completes the list of panic types you are likely to see. 177.Pp 178If the system has been configured to take crash dumps (see 179.Xr dumpon 8 ) , 180then when it crashes it will write (or at least attempt to write) 181an image of memory into the back end of the dump device, 182usually the same as the primary swap 183area. 184After the system is rebooted, the program 185.Xr savecore 8 186runs and preserves a copy of this core image and the current 187system in a specified directory for later perusal. 188See 189.Xr savecore 8 190for details. 191.Pp 192To analyze a dump you should begin by running 193.Xr kgdb 1 Pq Pa ports/devel/gdb 194on the system load image and core dump. 195If the core image is the result of a panic, 196the panic message is printed. 197For more details consult the chapter on kernel debugging in 198the 199.%B "FreeBSD Developers' Handbook" 200.Pq Pa https://www.freebsd.org/doc/en/books/developers-handbook/ . 201.Sh SEE ALSO 202.Xr kgdb 1 Pq Pa ports/devel/gdb , 203.Xr dumpon 8 , 204.Xr reboot 8 , 205.Xr savecore 8 206.Sh HISTORY 207The 208.Nm 209manual page first appeared in 210.Fx 2.2 . 211