what does it mean when an iPhone has a panic or a kernel panic?

1.15K views

what does it mean when an iPhone has a panic or a kernel panic?

In: Technology

3 Answers

Anonymous 0 Comments

Operating systems do a number of things but largely their most important role is to provide an environment in which multiple processes can run simultaneously. The operating system arranges various programs to run seemingly at the same time, having them share various resources, most importantly the CPU, which is shared by having each program get a few microseconds of computation from the CPU before that goes to another program.

The kernel is the core of the operating system. When a program decides “I don’t need any more CPU for now,” it gives control of the CPU back to the kernel so that the kernel can give it to another running program or do whatever it needs to do. When a program needs to get stuff from the internet, it asks the kernel to get it for it. When the program needs to access a file, it asks the operating system to get it for it, in the process checking if the program is allowed to even access this file.

A kernel panic happens when the kernel does something wrong, say divide by zero. Generally if an individual program does something illegal like this, control is returned to the kernel who decides what to do based on what it was programmed to do, generally this involves killing the program. It used to be that if a program did something wrong like this it would bring down the kernel too but we have gotten quite good at avoiding such situations.

The issue lies in the kernel doing something bad. If the kernel does something bad like divide by zero, this means the programmer who made the kernel messed up firstly, but also means that there is no real way to recover from it. If your future calculations rely on this division working but you divided by zero, then your future calculations don’t really make sense.

So it is programmed to crash. It tells the user something went wrong in the kernel panic screen (also in windows known as the Blue Screen of Death) and shuts itself down.

Anonymous 0 Comments

A “kernel panic” is a term used in Unix-like systems to signal encountering an error by the operating system from which it cannot gracefully recover. Computer programs are extremely complex logical sequences of operations and it can come about that a logical operation is attempted that cannot be completed.

For example you might have a computer trying to divide a number by zero; this shouldn’t ever be attempted because it cannot be done, but when things go wrong a program might be directed to try without any other option to resolve the situation. In a kernel panic event the operating system runs into a problem it cannot resolve and fails, usually dumping its memory contents for bug analysis and shutting down.

Anonymous 0 Comments

In addition to what the other commenters have mentioned, it should also be noted that a kernel panic occurs whenever an error is encountered by the operating system from which it cannot gracefully recover. There are many many small errors or unexpected hiccups that may occur within an individual program or part of the operating system that are handled either by the application itself or the operating system that it is running on that system. Usually when this happens, you will either see an error message, or see the program crash without causing the device to go into a complete panic.

[This video](https://www.youtube.com/watch?v=qTQJdGp4F34) provides a good analogy and demonstrates both an unhandled and a handled exception.