Re: Summary of Crash/Panic Behaviors in Linux Kernel
From: êëí
Date: Fri Sep 27 2019 - 20:22:53 EST
2019ë 9ì 27ì (ê) ìì 5:01, æåä <mudongliangabcd@xxxxxxxxx>ëì ìì:
>
> Dear all,
>
> Is there any summary of crash/panic behaviors in the Linux Kernel? For
> example, GPF (general protection fault), Kernel BUG (BUG_ON).
There are a number of blogs and material which describe the behavior
the kernel panic.
Talking about Android Linux Device, the behavior of kernel panic is as
followings:
USER DEBUG Version(Engineering version)
* On kernel panic, the device suddenly stops execution and keep on
displaying kernel log through the screen.
Below is one of the examples.
[ 34.187856 01-05 13:30:49.424] Unable to handle kernel NULL pointer
dereference at virtual address 00000000
[ 34.197812 01-05 13:30:49.434] pgd = e6f9c000
[ 34.202275 01-05 13:30:49.438] [00000000] *pgd=00000000
[ 34.207610 01-05 13:30:49.444] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 34.214663 01-05 13:30:49.451] Modules linked in: bcmdhd(O)
[ 34.220400 01-05 13:30:49.457] CPU: 0 Tainted: G W O
(3.4.65-gbc0bf75 #1)
[ 34.228317 01-05 13:30:49.464] PC is at ext4_free_inode+0x288/0x574
[ 34.234664 01-05 13:30:49.471] LR is at ext4_free_inode+0x260/0x574
Kernel engineers are able to notice what is the cause of the kernel
panic from kernel log.
USER Version(Production version)
* When kernel panic occurs, the device suddenly stops execution and
starts rebooting again.
In addition, we can describe BUG_ON() and exception as followings:
BUG_ON()
* If the subsystem realizes that it is running under critical condition,
BUG_ON() is called to cause kernel panic.
Please be aware that BUG_ON or BUG is executed only with CONFIG_BUG enabled.
Normally, many Linux devices are running with CONFIG_BUG enabled
*by default*.
Exception(Data abort, Prefeth abort: ARM processor)
* If MMU cannot handle the virtual address translation, exception occurs.
The program counter is jumped into predefined exception vector.
Usually panic() is called and then system is crashed.
Hope above would be helpful.
Thanks,
Austin Kim
>
> --
> My best regards to you.
>
> No System Is Safe!
> Dongliang Mu