Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Kernel panic

From Wikipedia, the free encyclopedia
Fatal error condition associated with Unix-like computer operating systems
Kernel panic inUbuntu 4.10, this one due to a VFS error

A kernel panic message from aLinux system
An OpenSolaris kernel panic.
AnOpenSolaris kernel panic
Kernel panic inUbuntu 13.04 "Raring Ringtail" (Linux kernel 3.8) inOracle VM VirtualBox

Akernel panic (sometimes abbreviated asKP[1]) is a safety measure taken by anoperating system'skernel upon detecting an internalfatal 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 toUnix andUnix-like systems. The equivalent onMicrosoft Windows operating systems is astop error, often called a "blue screen of death".

Thekernel routines that handle panics, known aspanic() inAT&T-derived andBSD Unix source code, are generally designed to output anerror message to theconsole, dump an image of kernel memory to disk forpost-mortem debugging, and then either wait for the system to be manually rebooted, or initiate an automaticreboot.[2] The information provided is of a highly technical nature and aims to assist asystem administrator orsoftware developer in diagnosing the problem. Kernel panics can also be caused by errors originating outsidekernel space. For example, many Unix operating systems panic if theinit process, which runs inuser space, terminates.[3][4]

History

[edit]

TheUnix kernel maintains internal consistency andruntime correctness withassertions as thefault detection mechanism. The basic assumption is that the hardware and the software should perform correctly and a failure of an assertion results in apanic, 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 predecessorMultics. Multics developerTom van Vleck recalls a discussion of this change with Unix developerDennis 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]

AWii U kernel panic log file

The originalpanic() function was essentially unchanged from Fifth Edition UNIX to theVAX-based UNIX 32V and output only an error message with no other information, then dropped the system into an endless idle loop. As the Unixcodebase was enhanced, thepanic() 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 asoftware bug in the operating system. In many cases, the operating system is capable of continued operation after an error has occurred. If the system is in an unstable state, rather than risking security breaches and data corruption, the operating system stops in order to prevent further damage, which helps to facilitate diagnosis of the error and may restart automatically.[7]

Kernel panic in Arch Linux
Kernel panic encountered in Arch Linux in Oracle VM VirtualBox. BSOD-style with an ASCII art of Tux and QR code leading to a Panic Report.

After recompiling a kernel binary image fromsource code, a kernel panic whilebooting the resulting kernel is a common problem if the kernel was not correctly configured, compiled or installed.[8] Add-on hardware or malfunctioningRAM could also be sources of fatal kernel errors during start up, due to incompatibility with the OS or a missingdevice driver.[9] A kernel may also go intopanic() if it is unable to locate aroot file system.[10] During the final stages of kerneluserspace initialization, a panic is typically triggered if the spawning ofinit fails. A panic might also be triggered if the init process terminates, as the system would then be unusable.[11]

The following is an implementation of the Linux kernel final initialization inkernel_init():[12]

staticint__refkernel_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))return0;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"))return0;panic("No init found.  Try passing init= option to kernel. ""See Linux Documentation/init.txt for guidance.");}

Operating system specifics

[edit]

Linux

[edit]
See also:kdump (Linux)
Kernel panic as seen on an iKVM console
Kernel panic with drm_panic enabled
Kernel panic with drm_panic enabled supporting logging to QR Codes

Kernel panics appear inLinux like in otherUnix-like systems; however, serious but non-fatal errors can generate another kind of error condition, known as akernel oops.[13] In this case, the kernel normally continues to run afterkilling the offendingprocess. 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.[14]

As of Linux 6.10, drm_panic was merged allowingDRM drivers to support drawing a panic screen to inform the user that a panic occurred. This allows a panic screen to appear even when a display server was running when the panic occurred.[15]

As of Linux 6.12, drm_panic was extended where the stack trace can be encoded as aQR code.[16]

macOS

[edit]

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

  • 10.0–10.1: The system displays text on the screen, giving details about the error, and becomes unresponsive.
  • 10.2: Rolls down a black transparent curtain then displays a message on a white background informing the user that they should restart the computer. The message is shown inEnglish,French,German andJapanese.
  • 10.3–10.5: Similar to 10.2, but the background of the error message is dark grey.
  • 10.6–10.7: The text has been revised and now includes aSpanish translation.
  • 10.8 and later: The computer becomes unresponsive before it immediately reboots. After restarting, it shows a message for a few seconds informing the user that a problem caused the computer to restart, before continuing to boot. The message now includes aChinese translation.

In macOS 10.8, if five new kernel panics occured within three minutes of the first one, the Mac would display aprohibitory sign for thirty seconds, and then shut down; this is known as a "recurring kernel panic".[19]

In all versions above 10.2, the text is superimposed on astandby symbol and is not full screen. Debugging information is saved inNVRAM 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.

  • Mac OS X 10.0–10.1 kernel panic
    Mac OS X 10.0–10.1 kernel panic
  • Mac OS X 10.2 kernel panic
    Mac OS X 10.2 kernel panic
  • Mac OS X 10.3–10.5 kernel panic
    Mac OS X 10.3–10.5 kernel panic
  • Mac OS X 10.6 and 10.7 kernel panic
    Mac OS X 10.6 and 10.7 kernel panic
  • Message shown after a system restart due to a kernel panic in OS X 10.8 and later versions
    Message shown after a system restart due to a kernel panic inOS X 10.8 and later versions

See also

[edit]
Wikimedia Commons has media related toKernel panic.

References

[edit]
  1. ^"KP - Kernel Panic (Linux) | AcronymFinder".www.acronymfinder.com.Archived from the original on October 26, 2015. RetrievedJanuary 6, 2016.
  2. ^"FreeBSD 11.0 - man page for panic (freebsd section 9) - Unix & Linux Commands".www.unix.com.Archived from the original on April 1, 2024. RetrievedOctober 26, 2010.
  3. ^"boot failure-init died - Unix Linux Forums - HP-UX".www.unix.com.Archived from the original on April 1, 2024. RetrievedJune 12, 2013.
  4. ^Randolph J. Herber (September 1, 1999)."Re: PANIC: init died".Newsgroupcomp.sys.sgi.admin.Archived from the original on January 22, 2011. RetrievedDecember 9, 2017.
  5. ^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. RetrievedMay 6, 2011.
  6. ^"Unix and Multics".www.multicians.org.Archived from the original on August 5, 2012. RetrievedMay 25, 2005.
  7. ^Steven M. Hancock (November 22, 2002).Tru64 UNIX troubleshooting: diagnosing and correcting system problems. Digital Press. pp. 119–126.ISBN 978-1-55558-274-6. RetrievedMay 3, 2011.
  8. ^Michael Jang (2006).Linux annoyances for geeks. O'Reilly Media, Inc. pp. 267–274.ISBN 978-0-596-00801-7. RetrievedApril 29, 2011.
  9. ^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. RetrievedMay 4, 2011.
  10. ^Greg Kroah-Hartman (2007).Linux kernel in a nutshell. O'Reilly Media, Inc. p. 59.ISBN 978-0-596-10079-7. RetrievedMay 3, 2011.
  11. ^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. RetrievedMay 3, 2011.
  12. ^"linux/init/main.c".LXR Cross Referencer.Archived from the original on October 6, 2022.
  13. ^"Linux Device Drivers, Chapter 4"(PDF).Archived(PDF) from the original on November 14, 2014. RetrievedJuly 21, 2016.
  14. ^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. RetrievedFebruary 5, 2016.
  15. ^"Changes/EnableDrmPanic".Fedora Project Wiki.
  16. ^Thomas Zimmermann (August 29, 2024)."[PULL] drm-misc-next".dri-devel (Mailing list).
  17. ^"OS X: About kernel panics - Apple Support".support.apple.com. Archived fromthe original on May 21, 2013.
  18. ^"A New Screen of Death for Mac OS X".OSXBook.com. Archived fromthe original on May 1, 2012. RetrievedApril 30, 2011.
  19. ^"OS X: About kernel panics".Apple Support. Apple. Archived fromthe original on May 24, 2018.
System failure
Application failure
Device and data errors
Other
Lists
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Kernel_panic&oldid=1322877985"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp