Panic! – what happens when a kernel panics
To conquer the beast, you must first understand it. In that spirit, let's panic!
The primary panic handling code in the kernel lies here: kernel/panic.c:panic()
. The panic()
function – the heart of it – receives, as parameters, a variable argument list – a printf
-style format specifier and associated variables (whose values will be printed):
// kernel/panic.c
/**
* panic - halt the system
* @fmt: The text string to print
*
* Display a message, then perform cleanups.
* This function never returns.
*/
void panic(const char *fmt, ...)
{ [...]
This function should (quite obviously) never be lightly invoked; calling it implies that the kernel is in an unusable, unusable state; once called, the system effectively comes to a grinding halt.
Let's panic
Here, with a view to being empirical and experimenting (on our test VM, of...