<s>
A	O
kernel	B-Operating_System
panic	I-Operating_System
(	O
sometimes	O
abbreviated	O
as	O
KP	O
)	O
is	O
a	O
safety	O
measure	O
taken	O
by	O
an	O
operating	B-General_Concept
system	I-General_Concept
's	O
kernel	B-Operating_System
upon	O
detecting	O
an	O
internal	O
fatal	B-Error_Name
error	I-Error_Name
in	O
which	O
either	O
it	O
is	O
unable	O
to	O
safely	O
recover	O
or	O
continuing	O
to	O
run	O
the	O
system	O
would	O
have	O
a	O
higher	O
risk	O
of	O
major	O
data	O
loss	O
.	O
</s>
<s>
The	O
term	O
is	O
largely	O
specific	O
to	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
The	O
equivalent	O
on	O
Microsoft	B-Application
Windows	I-Application
operating	I-Application
systems	I-Application
is	O
a	O
stop	O
error	O
,	O
often	O
called	O
a	O
"	O
blue	O
screen	O
of	O
death	O
"	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
routines	O
that	O
handle	O
panics	O
,	O
known	O
as	O
panic( )	O
in	O
AT&	O
T-derived	O
and	O
BSD	B-Operating_System
Unix	I-Operating_System
source	O
code	O
,	O
are	O
generally	O
designed	O
to	O
output	O
an	O
error	B-Error_Name
message	I-Error_Name
to	O
the	O
console	B-Device
,	O
dump	O
an	O
image	O
of	O
kernel	B-Operating_System
memory	O
to	O
disk	O
for	O
post-mortem	O
debugging	O
,	O
and	O
then	O
either	O
wait	O
for	O
the	O
system	O
to	O
be	O
manually	O
rebooted	O
,	O
or	O
initiate	O
an	O
automatic	O
reboot	B-Device
.	O
</s>
<s>
The	O
information	O
provided	O
is	O
of	O
a	O
highly	O
technical	O
nature	O
and	O
aims	O
to	O
assist	O
a	O
system	B-Application
administrator	I-Application
or	O
software	B-Application
developer	I-Application
in	O
diagnosing	O
the	O
problem	O
.	O
</s>
<s>
Kernel	B-Operating_System
panics	I-Operating_System
can	O
also	O
be	O
caused	O
by	O
errors	O
originating	O
outside	O
kernel	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
For	O
example	O
,	O
many	O
Unix	B-Application
operating	I-Application
systems	I-Application
panic	O
if	O
the	O
init	B-Operating_System
process	B-Operating_System
,	O
which	O
runs	O
in	O
user	B-Operating_System
space	I-Operating_System
,	O
terminates	O
.	O
</s>
<s>
The	O
Unix	B-Application
kernel	B-Operating_System
maintains	O
internal	O
consistency	O
and	O
runtime	B-Library
correctness	O
with	O
assertions	O
as	O
the	O
fault	O
detection	O
mechanism	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
panic	I-Operating_System
was	O
introduced	O
in	O
an	O
early	O
version	O
of	O
Unix	B-Application
and	O
demonstrated	O
a	O
major	O
difference	O
between	O
the	O
design	O
philosophies	O
of	O
Unix	B-Application
and	O
its	O
predecessor	O
Multics	B-Application
.	O
</s>
<s>
Multics	B-Application
developer	B-Application
Tom	O
van	O
Vleck	O
recalls	O
a	O
discussion	O
of	O
this	O
change	O
with	O
Unix	B-Application
developer	B-Application
Dennis	O
Ritchie	O
:	O
</s>
<s>
I	O
remarked	O
to	O
Dennis	O
that	O
easily	O
half	O
the	O
code	O
I	O
was	O
writing	O
in	O
Multics	B-Application
was	O
error	O
recovery	O
code	O
.	O
</s>
<s>
The	O
original	O
panic( )	O
function	O
was	O
essentially	O
unchanged	O
from	O
Fifth	O
Edition	O
UNIX	B-Application
to	O
the	O
VAX-based	O
UNIX	B-Application
32V	O
and	O
output	O
only	O
an	O
error	B-Error_Name
message	I-Error_Name
with	O
no	O
other	O
information	O
,	O
then	O
dropped	O
the	O
system	O
into	O
an	O
endless	O
idle	O
loop	O
.	O
</s>
<s>
Source	O
code	O
of	O
panic( )	O
function	O
in	O
V6	B-Operating_System
UNIX	I-Operating_System
:	O
</s>
<s>
As	O
the	O
Unix	B-Application
codebase	B-General_Concept
was	O
enhanced	O
,	O
the	O
panic( )	O
function	O
was	O
also	O
enhanced	O
to	O
dump	O
various	O
forms	O
of	O
debugging	O
information	O
to	O
the	O
console	B-Device
.	O
</s>
<s>
A	O
panic	O
may	O
occur	O
as	O
a	O
result	O
of	O
a	O
hardware	O
failure	O
or	O
a	O
software	B-Error_Name
bug	I-Error_Name
in	O
the	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
In	O
many	O
cases	O
,	O
the	O
operating	B-General_Concept
system	I-General_Concept
is	O
capable	O
of	O
continued	O
operation	O
after	O
an	O
error	O
has	O
occurred	O
.	O
</s>
<s>
However	O
,	O
the	O
system	O
is	O
in	O
an	O
unstable	O
state	O
and	O
rather	O
than	O
risking	O
security	O
breaches	O
and	O
data	O
corruption	O
,	O
the	O
operating	B-General_Concept
system	I-General_Concept
stops	O
to	O
prevent	O
further	O
damage	O
and	O
facilitate	O
diagnosis	O
of	O
the	O
error	O
and	O
,	O
in	O
usual	O
cases	O
,	O
restart	O
.	O
</s>
<s>
After	O
recompiling	O
a	O
kernel	B-Operating_System
binary	O
image	O
from	O
source	O
code	O
,	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
while	O
booting	B-Operating_System
the	O
resulting	O
kernel	B-Operating_System
is	O
a	O
common	O
problem	O
if	O
the	O
kernel	B-Operating_System
was	O
not	O
correctly	O
configured	O
,	O
compiled	O
or	O
installed	O
.	O
</s>
<s>
Add-on	O
hardware	O
or	O
malfunctioning	O
RAM	B-Architecture
could	O
also	O
be	O
sources	O
of	O
fatal	O
kernel	B-Operating_System
errors	O
during	O
start	O
up	O
,	O
due	O
to	O
incompatibility	O
with	O
the	O
OS	O
or	O
a	O
missing	O
device	B-Application
driver	I-Application
.	O
</s>
<s>
A	O
kernel	B-Operating_System
may	O
also	O
go	O
into	O
panic( )	O
if	O
it	O
is	O
unable	O
to	O
locate	O
a	O
root	B-Application
file	I-Application
system	I-Application
.	O
</s>
<s>
During	O
the	O
final	O
stages	O
of	O
kernel	B-Operating_System
userspace	B-Operating_System
initialization	O
,	O
a	O
panic	O
is	O
typically	O
triggered	O
if	O
the	O
spawning	O
of	O
init	B-Operating_System
fails	O
.	O
</s>
<s>
A	O
panic	O
might	O
also	O
be	O
triggered	O
if	O
the	O
init	B-Operating_System
process	B-Operating_System
terminates	O
,	O
as	O
the	O
system	O
would	O
then	O
be	O
unusable	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
implementation	O
of	O
the	O
Linux	B-Application
kernel	B-Operating_System
final	O
initialization	O
in	O
kernel_init( )	O
:	O
</s>
<s>
Kernel	B-Operating_System
panics	I-Operating_System
appear	O
in	O
Linux	B-Application
like	O
in	O
other	O
Unix-like	B-Operating_System
systems	I-Operating_System
,	O
but	O
they	O
can	O
also	O
generate	O
another	O
kind	O
of	O
error	O
condition	O
,	O
known	O
as	O
a	O
kernel	B-Application
oops	I-Application
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
kernel	B-Operating_System
normally	O
continues	O
to	O
run	O
after	O
killing	O
the	O
offending	O
process	B-Operating_System
.	O
</s>
<s>
As	O
an	O
oops	O
could	O
cause	O
some	O
subsystems	O
or	O
resources	O
to	O
become	O
unavailable	O
,	O
they	O
can	O
later	O
lead	O
to	O
a	O
full	O
kernel	B-Operating_System
panic	I-Operating_System
.	O
</s>
<s>
On	O
Linux	B-Application
,	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
causes	O
keyboard	O
LEDs	O
to	O
blink	O
as	O
a	O
visual	O
indication	O
of	O
a	O
critical	O
condition	O
.	O
</s>
<s>
When	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
occurs	O
in	O
Mac	B-Application
OS	I-Application
X	I-Application
10.2	O
through	O
10.7	O
,	O
the	O
computer	O
displays	O
a	O
multilingual	O
message	O
informing	O
the	O
user	O
that	O
they	O
need	O
to	O
reboot	B-Device
the	O
system	O
.	O
</s>
<s>
Prior	O
to	O
10.2	O
,	O
a	O
more	O
traditional	O
Unix-style	O
panic	O
message	O
was	O
displayed	O
;	O
in	O
10.8	O
and	O
later	O
,	O
the	O
computer	O
automatically	O
reboots	B-Device
and	O
displays	O
a	O
message	O
after	O
the	O
restart	O
.	O
</s>
<s>
10.310.5	O
:	O
The	O
kernel	B-Operating_System
panic	I-Operating_System
is	O
almost	O
the	O
same	O
as	O
version	O
10.2	O
but	O
the	O
background	O
of	O
the	O
error	B-Error_Name
screen	I-Error_Name
is	O
black	O
.	O
</s>
<s>
10.8	O
and	O
later	O
:	O
The	O
computer	O
becomes	O
unresponsive	O
before	O
it	O
immediately	O
reboots	B-Device
.	O
</s>
<s>
When	O
the	O
computer	O
starts	O
back	O
up	O
,	O
it	O
shows	O
a	O
warning	O
message	O
for	O
a	O
few	O
seconds	O
about	O
the	O
computer	O
restarting	O
because	O
of	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
,	O
and	O
then	O
the	O
computer	O
restarts	O
back	O
up	O
.	O
</s>
<s>
Sometimes	O
when	O
there	O
are	O
five	O
or	O
more	O
kernel	B-Operating_System
panics	I-Operating_System
within	O
three	O
minutes	O
of	O
the	O
first	O
one	O
,	O
the	O
Mac	O
will	O
display	O
a	O
prohibitory	O
sign	O
for	O
30	O
seconds	O
,	O
and	O
then	O
shut	O
down	O
;	O
this	O
is	O
known	O
as	O
a	O
"	O
recurring	O
kernel	B-Operating_System
panic	I-Operating_System
"	O
.	O
</s>
<s>
Debugging	O
information	O
is	O
saved	O
in	O
NVRAM	B-General_Concept
and	O
written	O
to	O
a	O
log	O
file	O
on	O
reboot	B-Device
.	O
</s>
<s>
In	O
10.7	O
there	O
is	O
a	O
feature	O
to	O
automatically	O
restart	O
after	O
a	O
kernel	B-Operating_System
panic	I-Operating_System
.	O
</s>
