Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 History  





2 Causes  





3 Operating system specifics  



3.1  Linux  





3.2  macOS  







4 See also  





5 References  














Kernel panic






العربية
Беларуская
Български
Català
Čeština
Deutsch
Español
Français
Galego

Bahasa Indonesia
Italiano
עברית
Lombard
Magyar


Norsk bokmål
Polski
Português
Русский
Suomi
Svenska

Türkçe
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


A kernel panic message from a Linux system
A OpenSolaris kernel panic.
AnOpenSolaris kernel panic.
Kernel panic in Ubuntu 13.04 "Raring Ringtail" (Linux kernel 3.8) in Oracle VM VirtualBox

Akernel panic (sometimes abbreviated as KP[1]) is a safety measure taken by an operating system's kernel upon detecting an internal fatal error in which either it is unable to safely recover or continuing to run the system would have a higher risk of major data loss. The term is largely specific to Unix and Unix-like systems. The equivalent on Microsoft Windows operating systems is a stop error, often called a "blue screen of death".

The kernel routines that handle panics, known as panic()inAT&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.[2] The information provided is of a highly technical nature and aims to assist a system administratororsoftware developer in diagnosing the problem. Kernel panics can also be caused by errors originating outside kernel space. For example, many Unix operating systems panic if the init process, which runs in user space, terminates.[3][4]

History[edit]

The Unix kernel maintains internal consistency and runtime correctness with assertions as the fault detection mechanism. The basic assumption is that the hardware and the software should perform correctly and a failure of an assertion results in a panic, i.e. a voluntary halt to all system activity.[5] The kernel panic was introduced in an early version of Unix and demonstrated a major difference between the design philosophies of Unix and its predecessor Multics. Multics developer Tom van Vleck recalls a discussion of this change with Unix developer Dennis Ritchie:

I remarked to Dennis that easily half the code I was writing in Multics was error recovery code. He said, "We left all that stuff out. If there's an error, we have this routine called panic, and when it is called, the machine crashes, and you holler down the hall, 'Hey, reboot it.'"[6]

The original panic() function was essentially unchanged from Fifth Edition UNIX to the VAX-based UNIX 32V and output only an error message with no other information, then dropped the system into an endless idle loop.

Source code of panic() function in V6 UNIX:[7]

/*
 * In case console is off,
 * panicstr contains argument to last
 * call to panic.
 */
char    *panicstr;

/*
 * Panic is called on unresolvable
 * fatal errors.
 * It syncs, prints "panic: mesg" and
 * then loops.
 */
panic(s)
char *s;
{
        panicstr = s;
        update();
        printf("panic: %s\n", s);
        for(;;)
                idle();
}

As the Unix codebase was enhanced, the panic() function was also enhanced to dump various forms of debugging information to the console.

Causes[edit]

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.[8]

After recompiling a kernel binary image from source code, a kernel panic while booting the resulting kernel is a common problem if the kernel was not correctly configured, compiled or installed.[9] 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.[10] A kernel may also go into panic() if it is unable to locate a root file system.[11] During the final stages of kernel userspace initialization, a panic is typically triggered if the spawning of init fails. A panic might also be triggered if the init process terminates, as the system would then be unusable.[12]

The following is an implementation of the Linux kernel final initialization in kernel_init():[13]

static int __ref kernel_init(void *unused)
{

         ...

        /*
         * We try each of these until one succeeds.
         *
         * The Bourne shell can be used instead of init if we are
         * trying to recover a really broken machine.
         */
        if (execute_command) {
                if (!run_init_process(execute_command))
                        return 0;
                pr_err("Failed to execute %s.  Attempting defaults...\n",
                        execute_command);
        }
        if (!run_init_process("/sbin/init") ||
            !run_init_process("/etc/init") ||
            !run_init_process("/bin/init") ||
            !run_init_process("/bin/sh"))
                return 0;

        panic("No init found.  Try passing init= option to kernel. "
              "See Linux Documentation/init.txt for guidance.");
}

Operating system specifics[edit]

Linux[edit]

Kernel panic as seen on an iKVM console

Kernel panics appear in Linux like in other Unix-like systems, but they can also generate another kind of error condition, known as a kernel oops.[14] In this case, the kernel normally continues to run after killing the offending process. As an oops could cause some subsystems or resources to become unavailable, they can later lead to a full kernel panic.

On Linux, a kernel panic causes keyboard LEDs to blink as a visual indication of a critical condition.[15]

macOS[edit]

When a kernel panic occurs in Mac OS X 10.2 through 10.7, the computer displays a multilingual message informing the user that they need to reboot the system.[16] Prior to 10.2, a more traditional Unix-style panic message was displayed; in 10.8 and later, the computer automatically reboots and displays a message after the restart. The format of the message varies from version to version:[17]

Sometimes when there are five or more kernel panics within three minutes of the first one, the Mac will display a prohibitory sign for 30 seconds, and then shut down; this is known as a "recurring kernel panic".[18]

In all versions above 10.2, the text is superimposed on a standby symbol and is not full screen. Debugging information is saved in NVRAM and written to a log file on reboot. In 10.7 there is a feature to automatically restart after a kernel panic. In some cases, on 10.2 and later, white text detailing the error may appear in addition to the standby symbol.

See also[edit]

References[edit]

  1. ^ "KP - Kernel Panic (Linux) | AcronymFinder". www.acronymfinder.com. Archived from the original on October 26, 2015. Retrieved January 6, 2016.
  • ^ "FreeBSD 11.0 - man page for panic (freebsd section 9) - Unix & Linux Commands". www.unix.com. Archived from the original on April 1, 2024. Retrieved October 26, 2010.
  • ^ "boot failure-init died - Unix Linux Forums - HP-UX". www.unix.com. Archived from the original on April 1, 2024. Retrieved June 12, 2013.
  • ^ Randolph J. Herber (September 1, 1999). "Re: PANIC: init died". Newsgroupcomp.sys.sgi.admin. Archived from the original on January 22, 2011. Retrieved December 9, 2017.
  • ^ Daniel P. Siewiorek; Robert S. Swarz (1998). Reliable computer systems: design and evaluation. A K Peters, Ltd. p. 622. ISBN 978-1-56881-092-8. Retrieved May 6, 2011.
  • ^ "Unix and Multics". www.multicians.org. Archived from the original on August 5, 2012. Retrieved May 25, 2005.
  • ^ "Source code /usr/sys/ken/prf.c". Archived from the original on February 24, 2021. from V6 UNIX
  • ^ Steven M. Hancock (November 22, 2002). Tru64 UNIX troubleshooting: diagnosing and correcting system problemsHP Technologies SeriesITPro collection. Digital Press. pp. 119–126. ISBN 978-1-55558-274-6. Retrieved May 3, 2011.
  • ^ Michael Jang (2006). Linux annoyances for geeks. O'Reilly Media, Inc. pp. 267–274. ISBN 978-0-596-00801-7. Retrieved April 29, 2011.
  • ^ David Pogue (December 17, 2009). Switching to the Mac: The Missing Manual, Snow Leopard Edition. O'Reilly Media, Inc. p. 589. ISBN 978-0-596-80425-1. Retrieved May 4, 2011.
  • ^ Greg Kroah-Hartman (2007). Linux kernel in a nutshell. O'Reilly Media, Inc. p. 59. ISBN 978-0-596-10079-7. Retrieved May 3, 2011.
  • ^ Wolfgang Mauerer (September 26, 2008). Professional Linux Kernel Architecture. John Wiley and Sons. pp. 1238–1239. ISBN 978-0-470-34343-2. Archived from the original on April 1, 2024. Retrieved May 3, 2011.
  • ^ "linux/init/main.c". LXR Cross Referencer. Archived from the original on October 6, 2022.
  • ^ "Linux Device Drivers, Chapter 4" (PDF). Archived (PDF) from the original on November 14, 2014. Retrieved July 21, 2016.
  • ^ James Kirkland; David Carmichael; Christopher L. Tinker; Gregory L. Tinker (May 2006). Linux Troubleshooting for System Administrators and Power Users. Prentice Hall. p. 62. ISBN 9780132797399. Archived from the original on April 1, 2024. Retrieved February 5, 2016.
  • ^ "OS X: About kernel panics - Apple Support". support.apple.com. Archived from the original on May 21, 2013.
  • ^ "A New Screen of Death for Mac OS X". OSXBook.com. Archived from the original on May 1, 2012. Retrieved April 30, 2011.
  • ^ "OS X: About kernel panics - Apple Support". support.apple.com. Archived from the original on May 24, 2018.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Kernel_panic&oldid=1233143252"

    Categories: 
    Computer errors
    Operating system kernels
    Screens of death
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Use mdy dates from October 2013
    Commons link from Wikidata
     



    This page was last edited on 7 July 2024, at 14:04 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki