异常情景的level1
异常情景的level1 是最底层 show 当前状况的 api
其他具体的异常情景会根据 自身情景 调用 这些api
oops
打印
Unable to ... 到 ---[ end trace
行为
如果调用panic,就会做panic的行为,否则只是打印
是什么时候会调用panic
1. panic_on_oops 为 1
2. in_interrupt
2.1 硬中断
2.2 软中断
2.3 NMI
panic
打印
Kernel panic ...
行为
通知感兴趣模块,死机或重启
被谁调用的
只有oops会调用panic
BUG
!CONFIG_BUG #define BUG() do {} while (1)
CONFIG_BUG && !HAVE_ARCH_BUG #define BUG() do {
printk("BUG: failure at %s:%d/%s()!n", __FILE__, __LINE__, __func__);
barrier_before_unreachable();
panic("BUG!");
} while (0)
CONFIG_BUG && HAVE_ARCH_BUG #define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE)
#define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE) // #define BUG_INSTR_VALUE 0xe7f001f2 // 以这个值为arm的二进制代码执行,会产生未定义指令异常
#define _BUG(file, line, value) __BUG(file, line, value)
#define __BUG(__file, __line, __value)
do {
asm volatile("1:t" BUG_INSTR(__value) "n"
".pushsection .rodata.str, "aMS", %progbits, 1n"
"2:t.asciz " #__file "n"
".popsectionn"
".pushsection __bug_table,"aw"n"
".align 2n"
"3:t.word 1b, 2bn"
"t.hword " #__line ", 0n"
".popsection");
unreachable();
} while (0)
BUG_ON
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
level2
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
825 printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx1n");
826 int *p = 0;
827 int a = 0;
828 a = *p;
829 printk("xxxxxxxxxxxxxxxxxxxxxxxxxxxx2n");
#0 __loop_delay () at arch/arm/lib/delay-loop.S:47
#1 0xc0045544 in panic (fmt=0xc0b1a010 "Attempted to kill init! exitcode=0x%08xn") at kernel/panic.c:200
#2 0xc00486cc in find_child_reaper (father=0xee8a8000) at kernel/exit.c:471
#3 0xc0048998 in forget_original_parent (father=0xee8a8000, dead=0xee8977a0) at kernel/exit.c:560
#4 0xc0048cd4 in exit_notify (tsk=0xee8a8000, group_dead=1) at kernel/exit.c:596
#5 0xc0049878 in do_exit (code=11) at kernel/exit.c:767
#6 0xc001dacc in oops_end (flags=1610613011, regs=0xee897b88, signr=11) at arch/arm/kernel/traps.c:313
#7 0xc001db7c in die (str=0xc0b17148 "Oops", regs=0xee897b88, err=23) at arch/arm/kernel/traps.c:333
#8 0xc002f960 in __do_kernel_fault (mm=0x0 <__vectors_start>, addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:150
#9 0xc0b0dc00 in do_page_fault (addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:392
#10 0xc0008798 in do_DataAbort (addr=0, fsr=23, regs=0xee897b88) at arch/arm/mm/fault.c:550
#11 0xc0b0c9d8 in __dabt_svc () at arch/arm/kernel/entry-armv.S:197
#12 0xc0b0c9d8 in __dabt_svc () at arch/arm/kernel/entry-armv.S:197
#13 0xc0b0c9d8 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 : [ 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 60000013 00030003 60000013 00000000 7c00: 00000000 60000013 eea0ec64 60000013 eea0ec64 eea0ec64 60000013 eea0ec64 7c20: eea0ec64 eea0ec00 00000001 60000013 c10fb134 00000000 00000000 eea0ec64 7c40: 60000013 00000000 c0affb44 c0615614 c10fb134 eea0ec00 eebe7144 80000001 7c60: eebe71e0 eebe71e0 c10fb134 eebe7140 00000004 c0314138 00000001 c0b95370 7c80: 00000000 00000001 eea0ecc4 eea0ecc4 00000001 eea0ec00 00000000 c0b95370 7ca0: eea0ec00 eea0ec08 c10c37ac c10c37c4 c10c37c4 eea0ec00 eea0ec00 00000000 7cc0: 00000000 00000000 c0affb44 c068a554 c10c37c4 eea0ec00 eea0ec64 eea0ec64 7ce0: eea0ec64 c069d468 ffffffff eea0ec00 00000000 eea0ec64 eea0ec64 00000000 7d00: 00000001 c1107f6c c1107f6c eea0ec08 eea0ed3c ffffffff eea0ecc4 00000000 7d20: ffffffff eea0ecc4 00000000 00000001 eea0ecc4 eea0ecc4 00000000 c0b95378 7d40: eea0ec00 00000001 eea0ec00 00000000 00000000 00000000 c0affb44 c068a90c 7d60: eea0ec00 c10c37c4 eea0ec08 eea0ec00 c0b95488 eea0ec00 eea0ec34 00000000 7d80: 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 00000050 000000d0 00000050 eea7f180 c0b951c4 c10c3aa8 00000000 7e20: ef5d0620 c068bec4 00000000 c10c37c4 00000000 00000000 00000006 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 00000000 00000001 7ea0: eefeb329 eefeb320 c0b1bb10 60000153 c10b1ef0 60000153 c10b1eec 00000000 7ec0: 60000013 60000013 60000013 a0000113 00000000 00000000 00000000 c0d0f40c 7ee0: 00000006 00000006 c0d0eb30 c10b1dc4 c10b1dc4 00000006 c10b1dc4 c0d901bc 7f00: ee8af6c0 c0d0f460 00000000 00000006 00000000 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 60000153 7f80: 60000153 ee8a83f4 ee8a8000 ee8a8000 00000000 c0affb54 00000000 00000000 7fa0: 00000000 eefc05c0 00000000 c0014de0 00000000 00000000 00000000 00000000 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ [ [ [ [ [ [ [ [ [ [ [ [ [
上一篇:OK6410A 开发板 (八) 64 linux-5.11 OK6410A linux异常解析
下一篇:OK6410A 开发板 (八) 62 linux-5.11 OK6410A linux应用空间常见的异常情景及分析
推荐阅读最新更新时间:2024-11-11 05:14
设计资源 培训 开发板 精华推荐
- 基于单片机的电机转速测量系统设计(答辩版)完整毕业设计论文附图及源程序
- NCN8025AEVB,NCN8025A 适配卡评估板
- bot-1
- ODRIVE3.5(DRV8303)
- LT3976 演示板、40V、5A、2MHz 降压型开关稳压器,具有 3.3A 静态电流
- PAM8901JER 25MW True CAP Free 立体声耳机放大器差分输入信号的典型应用配置
- LTC2485、24 位 ADC 的典型应用,具有简单的驱动输入电流消除和 I2C 接口
- 用于微功率 A/D 转换器的 LT1634BIS8-1.25 电压基准的典型应用
- 555 4017
- LT1010 的典型应用 - 快速 150mA 电源缓冲器