level2 的话 有很多,level 2 对应了具体的异常情景
比如 除0 的函数路径
比如 缺页 的函数路径
1. 踩内存、硬件Bit位翻转导致的数据异常
一般需要同时编译出来的符号表(vmlinux)进行反汇编分析
Unable to handle kernel paging request at virtual address XXXXXXXXX
2. 调用BUG // arm64 BUG 直接调用 panic
代码中出现异常导致调用到BUG()触发的主动重启
Kernel BUG at ffffff8008311ac8 [verbose debug info unavailable]3. oom
Out of memory意味着已无可用的memory,这样的问题必然存在一些耗费资源的进程耗尽了memory的资源触发的KE
Kernel panic - not syncing: Out of memory and no killable processes...4. 未定义指令异常
一般是CPU/DRAM不稳定导致的问题
Internal error: Oops - undefined instruction
5. 卡死导致硬件看门狗超时
多见于底层频繁irq/bus卡死,导致kicker无法被schedule,从而引起watch dog触发中断
引导系统进入FIQ处理流程,最终call到BUG触发重启。 // wathchdog 是 fiq ???
(表现为HWT和Hardware Reboot)
6. 软件看门狗超时
MTK平台有hang_detect的机制,system_server进程每30S回去软件喂狗
如果系统卡在超过10min/11min/12min/14min时,会dump出不同的信息用于debug。
level2 实例
clcdfb_probe
825printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx1\n");826int*p =0;827int a =0;828 a =*p;829printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx2\n");
#0__loop_delay() at arch/arm/lib/delay-loop.S:47
#10xc0045544 in panic(fmt=0xc0b1a010"Attempted to kill init! exitcode=0x%08x\n") at kernel/panic.c:200
#20xc00486cc in find_child_reaper(father=0xee8a8000) at kernel/exit.c:471
#30xc0048998 in forget_original_parent(father=0xee8a8000, dead=0xee8977a0) at kernel/exit.c:560
#40xc0048cd4 in exit_notify(tsk=0xee8a8000, group_dead=1) at kernel/exit.c:596
#50xc0049878 in do_exit(code=11) at kernel/exit.c:767
#60xc001dacc in oops_end(flags=1610613011, regs=0xee897b88, signr=11) at arch/arm/kernel/traps.c:313
#70xc001db7c in die(str=0xc0b17148"Oops", regs=0xee897b88, err=23) at arch/arm/kernel/traps.c:333
#80xc002f960 in __do_kernel_fault(mm=0x0<__vectors_start>, addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:150
#90xc0b0dc00 in do_page_fault(addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:392
#100xc0008798 in do_DataAbort(addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:550
#110xc0b0c9d8 in __dabt_svc() at arch/arm/kernel/entry-armv.S:197
#120xc0b0c9d8 in __dabt_svc() at arch/arm/kernel/entry-armv.S:197
#130xc0b0c9d8 in __dabt_svc() at arch/arm/kernel/entry-armv.S:197
xxxxxxxxxxxxxxxxxxxxxxxxxxxx1
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000]*pgd=00000000
Internal error: Oops:17[#1] SMP ARM
Modules linked in:
CPU:0 PID:1 Comm: swapper/0 Not tainted 4.0.0 #10
Hardware name: ARM-Versatile Express
task: ee8a8000 ti: ee896000 task.ti: ee896000
PC is at clcdfb_probe+0x44/0x2f0
LR is at clcdfb_probe+0x30/0x2f0
pc :[<c06134e8>] lr :[<c06134d4>] psr:60000013
sp : ee897bd0 ip :00000004 fp :00000000
r10:00000000 r9 :00000000 r8 :00000000
r7 :00000000 r6 :00000000 r5 : c0affb44 r4 :00000000
r3 :00000000 r2 : c10b37a8 r1 :60000013 r0 :0000001d
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control:10c5387d Table:8ebcc059 DAC:00000015
Process swapper/0(pid:1, stack limit =0xee896210)
Stack:(0xee897bd0 to 0xee898000)7bc0:60000013 c10c8afc c10c37ac eea0ec00
7be0:60000013 eea0ec64 c10c8b60 c10c8b60 600000130003000360000013000000007c00:0000000060000013 eea0ec64 60000013 eea0ec64 eea0ec64 60000013 eea0ec64
7c20: eea0ec64 eea0ec00 0000000160000013 c10fb134 0000000000000000 eea0ec64
7c40:6000001300000000 c0affb44 c0615614 c10fb134 eea0ec00 eebe7144 800000017c60: eebe71e0 eebe71e0 c10fb134 eebe7140 00000004 c0314138 00000001 c0b95370
7c80:0000000000000001 eea0ecc4 eea0ecc4 00000001 eea0ec00 00000000 c0b95370
7ca0: eea0ec00 eea0ec08 c10c37ac c10c37c4 c10c37c4 eea0ec00 eea0ec00 000000007cc0:0000000000000000 c0affb44 c068a554 c10c37c4 eea0ec00 eea0ec64 eea0ec64
7ce0: eea0ec64 c069d468 ffffffff eea0ec00 00000000 eea0ec64 eea0ec64 000000007d00:00000001 c1107f6c c1107f6c eea0ec08 eea0ed3c ffffffff eea0ecc4 000000007d20: ffffffff eea0ecc4 0000000000000001 eea0ecc4 eea0ecc4 00000000 c0b95378
7d40: eea0ec00 00000001 eea0ec00 000000000000000000000000 c0affb44 c068a90c
7d60: eea0ec00 c10c37c4 eea0ec08 eea0ec00 c0b95488 eea0ec00 eea0ec34 000000007d80: ee95f9c0 c068ab90 c10c37c4 eea0ec00 00000000 eea0ec00 c10c37c4 ee897dc8
7da0: ee95f980 eea0ec00 c10c8a98 c10c37c4 ee95e774 c0687aa8 c068aac0 c10c37c4
7dc0:00000000 c10c3aa8 ee95e75c ee95f9b4 eea0ec00 00000000 c10c8994 c068ac0c
7de0: ee95e770 c10c37c4 c0688858 c06888b0 c0b8e7f0 ee93ef80 00000000 c10c37c4
7e00:000080d0 00000050000000d0 00000050 eea7f180 c0b951c4 c10c3aa8 000000007e20: ef5d0620 c068bec4 00000000 c10c37c4 000000000000000000000006 c0615a04
7e40:00000000 c10c37c4 eeb31380 c0d57280 00000000 c0008dc8 ee891130 c007dc78
7e60:000000a2 c0d5724c 00000006 c0d0eb30 000000a2 c0cd69f8 eefeb32a c0b12200
7e80:000000d0 c10fa0ec 60000153 c10b1eec c10fa0ec c10fa0ec 00000000000000017ea0: eefeb329 eefeb320 c0b1bb10 60000153 c10b1ef0 60000153 c10b1eec 000000007ec0:600000136000001360000013 a0000113 000000000000000000000000 c0d0f40c
7ee0:0000000600000006 c0d0eb30 c10b1dc4 c10b1dc4 00000006 c10b1dc4 c0d901bc
7f00: ee8af6c0 c0d0f460 000000000000000600000000 c0d0f4ac 00000000 c0d0f724
7f20:2df17000 ee8a84c0 00000000 c10ac7e4 c10ac7e4 ee8a8000 eefc05c0 eefc05c0
7f40:00000001 ee8a83f4 ee8a83f4 ee8a83f4 ee8a83f4 ee8a8000 60000153 c10b8e98
7f60:60000153 ee8a842c ee8a842c ee8a842c 00000000 ee8a842c ee8a842c 600001537f80:60000153 ee8a83f4 ee8a8000 ee8a8000 00000000 c0affb54 00000000000000007fa0:00000000 eefc05c0 00000000 c0014de0 000000000000000000000000000000007fc0:00000000000000000000000000000000000000000000000000000000000000007fe0:0000000000000000000000000000000000000013000000000000000000000000[<c06134e8>](clcdfb_probe) from [<c0615614>](amba_probe+0x11c/0x238)[<c0615614>](amba_probe) from [<c068a554>](really_probe+0x210/0x424)[<c068a554>](really_probe) from [<c068a90c>](driver_probe_device+0x84/0xac)[<c068a90c>](driver_probe_device) from [<c068ab90>](__driver_attach+0xd0/0x124)[<c068ab90>](__driver_attach) from [<c0687aa8>](bus_for_each_dev+0x90/0xd8)[<c0687aa8>](bus_for_each_dev) from [<c068ac0c>](driver_attach+0x28/0x38)[<c068ac0c>](driver_attach) from [<c06888b0>](bus_add_driver+0x15c/0x2a8)[<c06888b0>](bus_add_driver) from [<c068bec4>](driver_register+0x10c/0x17c)[<c068bec4>](driver_register) from [<c0615a04>](amba_driver_register+0x88/0x98)[<c0615a04>](amba_driver_register) from [<c0d57280>](amba_clcdfb_init+0x34/0x40)[<c0d57280>](amba_clcdfb_init) from [<c0008dc8>](do_one_initcall+0x68/0x190)[<c0008dc8>](do_one_initcall) from [<c0d0f40c>](do_initcall_level+0xc8/0x100)[<c0d0f40c>](do_initcall_level) from [<c0d0f460>](do_initcalls+0x1c/0x40)[<c0d0f460>](do_initcalls) from [<c0d0f4ac>](do_basic_setup+0x28/0x34)[<c0d0f4ac>](do_basic_setup) from [<c0d0f724>](kernel_init_freeable+0x218/0x2c4)[<c0d0f724>](kernel_init_freeable) from [<c0affb54>](kernel_init+0x10/0x16c)[<c0affb54>](kernel_init) from [<c0014de0>](ret_from_fork+0x14/0x34)
Code: e58d3068 e3a03000 e58d3064 e59d3068(e5933000)---[ end trace 3d127599db201418 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
xxxxxxxxxxxxxxxxxxxxxxxxxxxx1
---// __do_kernel_fault
Unable to handle kernel NULL pointer dereference at virtual address 00000000// __do_kernel_fault->show_pte
pgd = c0004000
[00000000]*pgd=00000000---// __do_kernel_fault->die->__die
Internal error: Oops:17[#1] SMP ARM
---// __do_kernel_fault->die->__die->print_modules
Modules linked in:---// __do_kernel_fault->die->__die->__show_regs->show_regs_print_info->dump_stack_print_info
CPU:0 PID:1 Comm: swapper/0 Not tainted 4.0.0 #10
Hardware name: ARM-Versatile Express
task: ee8a8000 ti: ee896000 task.ti: ee896000
// __do_kernel_fault->die->__die->__show_regs
PC is at clcdfb_probe+0x44/0x2f0
LR is at clcdfb_probe+0x30/0x2f0
pc :[<c06134e8>] lr :[<c06134d4>] psr:60000013
sp : ee897bd0 ip :00000004 fp :00000000
r10:00000000 r9 :00000000 r8 :00000000
r7 :00000000 r6 :00000000 r5 : c0affb44 r4 :00000000
r3 :00000000 r2 : c10b37a8 r1 :60000013 r0 :0000001d
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control:10c5387d Table:8ebcc059 DAC:00000015---// __do_kernel_fault->die->__die
Process swapper/0(pid:1, stack limit =0xee896210)// __do_kernel_fault->die->__die->dump_mem
Stack:(0xee897bd0 to 0xee898000)7bc0:60000013 c10c8afc c10c37ac eea0ec00
7be0:60000013 eea0ec64 c10c8b60 c10c8b60 600000130003000360000013000000007c00:0000000060000013 eea0ec64 60000013 eea0ec64 eea0ec64 60000013 eea0ec64
7c20: eea0ec64 eea0ec00 0000000160000013 c10fb134 0000000000000000 eea0ec64
7c40:6000001300000000 c0affb44 c0615614 c10fb134 eea0ec00 eebe7144 800000017c60: eebe71e0 eebe71e0 c10fb134 eebe7140 00000004 c0314138 00000001 c0b95370
7c80:0000000000000001 eea0ecc4 eea0ecc4 00000001 eea0ec00 00000000 c0b95370
7ca0: eea0ec00 eea0ec08 c10c37ac c10c37c4 c10c37c4 eea0ec00 eea0ec00 000000007cc0:0000000000000000 c0affb44 c068a554 c10c37c4 eea0ec00 eea0ec64 eea0ec64
7ce0: eea0ec64 c069d468 ffffffff eea0ec00 00000000 eea0ec64 eea0ec64 000000007d00:00000001 c1107f6c c1107f6c eea0ec08 eea0ed3c ffffffff eea0ecc4 000000007d20: ffffffff eea0ecc4 0000000000000001 eea0ecc4 eea0ecc4 00000000 c0b95378
7d40: eea0ec00 00000001 eea0ec00 000000000000000000000000 c0affb44 c068a90c
7d60: eea0ec00 c10c37c4 eea0ec08 eea0ec00 c0b95488 eea0ec00 eea0ec34 000000007d80: ee95f9c0 c068ab90 c10c37c4 eea0ec00 00000000 eea0ec00 c10c37c4 ee897dc8
7da0: ee95f980 eea0ec00 c10c8a98 c10c37c4 ee95e774 c0687aa8 c068aac0 c10c37c4
7dc0:00000000 c10c3aa8 ee95e75c ee95f9b4 eea0ec00 00000000 c10c8994 c068ac0c
7de0: ee95e770 c10c37c4 c0688858 c06888b0 c0b8e7f0 ee93ef80 00000000 c10c37c4
7e00:000080d0 00000050000000d0 00000050 eea7f180 c0b951c4 c10c3aa8 000000007e20: ef5d0620 c068bec4 00000000 c10c37c4 000000000000000000000006 c0615a04
7e40:00000000 c10c37c4 eeb31380 c0d57280 00000000 c0008dc8 ee891130 c007dc78
7e60:000000a2 c0d5724c 00000006 c0d0eb30 000000a2 c0cd69f8 eefeb32a c0b12200
7e80:000000d0 c10fa0ec 60000153 c10b1eec c10fa0ec c10fa0ec 00000000000000017ea0: eefeb329 eefeb320 c0b1bb10 60000153 c10b1ef0 60000153 c10b1eec 000000007ec0:600000136000001360000013 a0000113 000000000000000000000000 c0d0f40c
7ee0:0000000600000006 c0d0eb30 c10b1dc4 c10b1dc4 00000006 c10b1dc4 c0d901bc
7f00: ee8af6c0 c0d0f460 000000000000000600000000 c0d0f4ac 00000000 c0d0f724
7f20:2df17000 ee8a84c0 00000000 c10ac7e4 c10ac7e4 ee8a8000 eefc05c0 eefc05c0
7f40:00000001 ee8a83f4 ee8a83f4 ee8a83f4 ee8a83f4 ee8a8000 60000153 c10b8e98
7f60:60000153 ee8a842c ee8a842c ee8a842c 00000000 ee8a842c ee8a842c 600001537f80:60000153 ee8a83f4 ee8a8000 ee8a8000 00000000 c0affb54 00000000000000007fa0:00000000 eefc05c0 00000000 c0014de0 000000000000000000000000000000007fc0:00000000000000000000000000000000000000000000000000000000000000007fe0:0000000000000000000000000000000000000013000000000000000000000000---// __do_kernel_fault->die->__die->dump_backtrace[<c06134e8>](clcdfb_probe) from [<c0615614>](amba_probe+0x11c/0x238)[<c0615614>](amba_probe) from [<c068a554>](really_probe+0x210/0x424)[<c068a554>](really_probe) from [<c068a90c>](driver_probe_device+0x84/0xac)[<c068a90c>](driver_probe_device) from [<c068ab90>](__driver_attach+0xd0/0x124)[<c068ab90>](__driver_attach) from [<c0687aa8>](bus_for_each_dev+0x90/0xd8)[<c0687aa8>](bus_for_each_dev) from [<c068ac0c>](driver_attach+0x28/0x38)[<c068ac0c>](driver_attach) from [<c06888b0>](bus_add_driver+0x15c/0x2a8)[<c06888b0>](bus_add_driver) from [<c068bec4>](driver_register+0x10c/0x17c)[<c068bec4>](driver_register) from [<c0615a04>](amba_driver_register+0x88/0x98)[<c0615a04>](amba_driver_register) from [<c0d57280>](amba_clcdfb_init+0x34/0x40)[<c0d57280>](amba_clcdfb_init) from [<c0008dc8>](do_one_initcall+0x68/0x190)[<c0008dc8>](do_one_initcall) from [<c0d0f40c>](do_initcall_level+0xc8/0x100)[<c0d0f40c>](do_initcall_level) from [<c0d0f460>](do_initcalls+0x1c/0x40)[<c0d0f460>](do_initcalls) from [<c0d0f4ac>](do_basic_setup+0x28/0x34)[<c0d0f4ac>](do_basic_setup) from [<c0d0f724>](kernel_init_freeable+0x218/0x2c4)[<c0d0f724>](kernel_init_freeable) from [<c0affb54>](kernel_init+0x10/0x16c)[<c0affb54>](kernel_init) from [<c0014de0>](ret_from_fork+0x14/0x34)---// __do_kernel_fault->die->__die->dump_instr->__dump_instr->
Code: e58d3068 e3a03000 e58d3064 e59d3068(e5933000)---// __do_kernel_fault->die->oops_end->oops_exit->print_oops_end_marker---[ end trace 3d127599db201418 ]------// __do_kernel_fault->die->oops_end->panic
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b---// __do_kernel_fault->die->oops_end->panic---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b