A kernel panic is an action taken by an operating system upon detecting an internal fatal error from which it cannot safely recover. The term is largely specific to Unix and Unix-like systems; for Microsoft Windows operating systems the equivalent term is “stop error” (or, colloquially, “Blue Screen of Death”).
The kernel routines that handle panics, known as
panic() in AT&T-derived and BSD Unix source code, are generally designed to output an error message to the console, dump an image of kernel memory to disk for post-mortem debugging and then either wait for the system to be manually rebooted, or initiate an automatic reboot. The information provided is of a highly technical nature and aims to assist asystem administrator or software developer in diagnosing the problem. Kernel panics can also be caused by errors originating outside of kernel space. For example, many Unix OSes panic if the init process, which runs in userspace, terminates.
A panic may occur as a result of a hardware failure or a software bug in the operating system. In many cases, the operating system is capable of continued operation after an error has occurred. However, the system is in an unstable state and rather than risking security breaches and data corruption, the operating system stops to prevent further damage and facilitate diagnosis of the error and, in usual cases, restart.
After recompiling a kernel binary image from source code, a kernel panic during booting the resulting kernel is a common problem if the kernel was not correctly configured, compiled or installed. Add-on hardware or malfunctioning RAM could also be sources of fatal kernel errors during start up, due to incompatibility with the OS or a missing device driver. A kernel may also die with a panic message if it is unable to locate a root file system. During the final stages of kernel userspace initialization, a panic is typically triggered if the spawning of init fails, as the system would then be unusable.
If you’re seeing repeated kernel panics, try the following things until they go away.
Do a safe boot: Restart your Mac and hold down the Shift key until you see the gray Apple logo. Doing so temporarily disables some software that could cause problems and runs some cleanup processes. If the kernel panic doesn’t recur, restart again normally.
Update your software: Outdated software is frequently implicated in kernel panics. This may include OS X itself and, very rarely, regular applications. More often it involves low-level software like kernel extensions and drivers. If you’ve installed software that goes with peripherals (network adapters, audio interfaces, graphics cards, input devices, etc.) or antivirus, file-system, or screen-capture tools, those should be the first you check for newer versions. Choose Software Update from the Apple menu to update OS X, Apple apps, and items purchased from the Mac App Store; for other apps, use a built-in updater or check the developer’s website.
Update your firmware: Software Update may also tell you about available updates for your Mac. If so, be sure to install them. You can also check for any firmware updates applicable to your Mac model at http://support.apple.com/kb/ht1237.
Check your disk: Make sure your startup disk has at least 10GB of free space; if it doesn’t, delete some files to make room. Next, to find and fix any disk errors, start from another volume, run Disk Utility, select your startup disk, and click Repair Disk. (The easiest way to do this, if you’re running OS X 10.7 or later, is to restart and then immediately press and hold Command-R to enter OS X Recovery. If that doesn’t work, or if you have an older system, you can start up from a bootable duplicate of your hard disk or OS X install media.)
Check peripherals: If kernel panics continue, shut down your Mac and disconnect everything except the bare minimum (keyboard, pointing device, and display if those aren’t built in)—as well as any hardware you’ve added inside your Mac, such as a graphics card. Turn your Mac back on. If the problem doesn’t reappear, repeat the process, reattaching one device at a time. If you see a kernel panic right after connecting a piece of hardware, that may be your culprit.
Check your RAM: Defective RAM can cause kernel panics, and sometimes these defects manifest themselves only after time. If you’ve added any after-market RAM, try turning off your Mac, removing the extra RAM, and restarting. If that makes the kernel panics disappear, contact the company that sold you the RAM to see about a warranty replacement.