自己遇到的错误日志:
[ 1.287838] ap3216c 0-001e: ap3216c init failed
[ 1.292450] ap3216c: probe of 0-001e failed with error -1 备注ap3216是IIC错误2022.10.21
[ 1.300041] Unhandled fault: external abort on non-linefetch (0x008) at 0x9094800c
[ 1.307658] pgd = 80004000
[ 1.310387] [9094800c] *pgd=86000811, *pte=02284653, *ppte=02284453
[ 1.316771] Internal error: : 8 [#1] PREEMPT SMP ARM
翻译后:
[1.287890]ap3216c 0-001e:ap3216c初始化失败
[1.292502]ap3216c:0-001e的探测失败,错误为-1
[1.300090]未处理的故障:0x9094800c处的非行提取(0x008)外部中止
[1.307658]pgd=80004000
[1.310387][9094800c]*pgd=86000811,*pte=02284653,*ppte=02284453
[1.316771]内部错误::8[#1]PREMPT SMP ARM
根据下文的意思是应该是0x9094800c这个地址被非法访问了,这也就和日志最后报错exitcode=0x0000000b,这个代码是意思是访问非法地址。在exitcode=0x0000000b博文中专门论述。但是即使知道了这个错误也不知道如何修改
最近遇到一个kernel奔溃的问题,错误日志开头一部分如下:
[ 355.262451@0] Unhandled fault: external abort on non-linefetch (0x008) at 0xfe004328
[ 355.264547@0] Internal error: : 8 [#1] PREEMPT SMP ARM
[ 355.269632@0] Modules linked in: audio_data mali aml_thermal otz_client(O)
[ 355.276449@0] CPU: 0 PID: 287 Comm: sh Tainted: G O 3.10.33 #1
[ 355.283088@0] task: d9356400 ti: da42a000 task.ti: da42a000
[ 355.288616@0] PC is at dbg_do_command+0x214/0x550
[ 355.293267@0] LR is at dbg_do_command+0x1ec/0x550
[ 355.297924@0] pc : [<c002b694>] lr : [<c002b66c>] psr: 800b0113
[ 355.297924@0] sp : da42bf00 ip : 00000030 fp : 00000000
[ 355.309652@0] r10: dabe930c r9 : da42bf80 r8 : fe004328
[ 355.314999@0] r7 : 00000030 r6 : dac70680 r5 : 00000010 r4 : c090b4bc
[ 355.321641@0] r3 : 00000000 r2 : fe004328 r1 : fe004328 r0 : fe004328
[ 355.328283@0] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 355.335528@0] Control: 10c5387d Table: 1a62c04a DAC: 00000015
[ 355.341395@0]
对于没有debug经验的人来讲,这段东西其实看得是一头雾水。”external abort on non-linefetch“这是个什么错误呢?网上找到了一个参考链接:
http://www.it1352.com/230717.html
打开连接202210.24
本文介绍了做这些内核崩溃错误是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我 insmod的
在ARM平台上的内核模块,我得到一个内核恐慌导致这三个错误被打印到屏幕
未处理的错误:对非linefetch外部中止(量0x008)
未处理的故障:IM precise外部中止(0xc06)
-
内核恐慌 - 不同步:在中断致命异常
- 什么是那些价值在括号?
- 这是什么
3
意味着这听起来像调度,而原子,但有
一个内核模块中没有这样的事?
解决方案
在括号内的值是 IFSR
(指示故障状态)注册。没有关于中止的原因很多这些给出具体原因。还有在内核中的某些表用于处理特定的故障原因和其他有处理它做了的printk
并中止任务或能恐慌()
内核。参见:<一href=\"https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/arm/mm/fault.c\">arm/mm/fault.c.该值可能是不值钱的,除非你正在开发一个错误处理程序。虽然它可以给的故障是关于什么的想法,最好是刚拿到 PC
,并期待在code。在该地址(我认为这是已经打印?)。
这些故障可能发生在任何地方;在用户任务,内核任务或中断
处理程序等。由于你的中断
处理程序崩溃,Linux的决定停止一切不打扰程序。否则,你可能会破坏磁盘(甚至更多)等。
请注意:每个的的故障状态寄存器的具有的 abort.S 的文件,该文件是为特定的ARM CPU不同。例如参见<一个href=\"https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/arm/mm/abort-ev7.S\">abort-ev7.S v7_early_abort
。这是把在<一href=\"https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/arm/mm/proc-v7.S\">processor它在系统启动时匹配表。
- 的未处理的故障的 - 试图读取未映射(通过MMU)内存
- 的内核恐慌的 - 一个的未处理的故障的发生在code视为不可恢复
I insmod
a kernel module on ARM platform and I get a kernel panic which causes this three errors to be printed to screen
Unhandled fault: external abort on non-linefetch (0x008)
Unhandled fault: imprecise external abort (0xc06)
-
Kernel panic - not syncing: Fatal exception in interrupt
- What are those values in parenthesis ?
- What does
3
mean It sounds like scheduling while atomic but there is no such thing in a kernel module.?
解决方案
The values in parenthesis are the ifsr
(instruction fault status) register. There are many causes for aborts and these give a specific cause. There are some tables in the kernel that handle particular fault causes and other have a handler which does a printk
and aborts a task or can panic()
the kernel. See: arm/mm/fault.c. The value is probably not valuable unless you are developing a fault handler. Although it can give an idea of what the fault is about, it is better just to get the PC
and look at the code at that address (which I think was already printed?).
These faults can occur anywhere; in a user task, a kernel task or an interrupt
handler, etc. Since your interrupt
handler has crashed, Linux decides to stop everything and not bother proceeding. Otherwise, you could corrupts disks (even more), etc.
Note: Each fault status register has an abort.S file which is different for the particular ARM CPU. For example see abort-ev7.S v7_early_abort
. This is put in a processor table which is matched at boot time.
- Unhandled fault - trying to read memory that is not mapped (via MMU).
- Kernel panic - an unhandled fault occurred in code deemed un-recoverable.
这篇关于做这些内核崩溃错误是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
连接内容结束2022.10.24
这个错误大概是因为试图读取未映射(通过MMU)的内存,按我的理解就是访问了非法的内存地址或者说这个内存地址根本不存在。不管怎么样,反汇编一下看看大概原因吧。
正文
1、
首先我们要反汇编一下vmlinux,命令如下:
arm-linux-gnueabihf-objdump -D vmlinux > vmlinux.dis
2、
再看一下错误日志的信息:
[ 355.288616@0] PC is at dbg_do_command+0x214/0x550
[ 355.293267@0] LR is at dbg_do_command+0x1ec/0x550
[ 355.297924@0] pc : [<c002b694>] lr : [<c002b66c>] psr: 800b0113
内核是奔溃在dbg_do_command函数的0x214偏移处,也就是地址0xc002b694的地方,另外0x550是dbg_do_command函数的大小,这个我们暂且不用理会。而lr寄存器保存了返回的地址,也就是地址0xc002b66c。
我们用c002b694地址在vmlinux.dis里面搜索一下,得到以下结果:
...
c002b68c: ea000083 b c002b8a0 <dbg_do_command+0x420>
c002b690: f57ff05f dmb sy
c002b694: e5903000 ldr r3, [r0]
c002b698: e3570030 cmp r7, #48 ; 0x30
...
3、
从上面一步,我们可以看到出错的地方是一条读取指令:
ldr r3, [r0]
我们再看一下出错时候各寄存器的值:
[ 355.297924@0] sp : da42bf00 ip : 00000030 fp : 00000000
[ 355.309652@0] r10: dabe930c r9 : da42bf80 r8 : fe004328
[ 355.314999@0] r7 : 00000030 r6 : dac70680 r5 : 00000010 r4 : c090b4bc
[ 355.321641@0] r3 : 00000000 r2 : fe004328 r1 : fe004328 r0 : fe004328
我们可以看到这时候,r0=fe004328,r3=00000000。r3寄存器没什么问题,那就是访问内存地址0xfe004328出现这个错误了。这个地址是芯片商FAE告诉我的,它是一个寄存器的地址,可以通过设置它来打开展频功能。我将这个错误反馈给他们,查实后原来他们给错地址值了,囧!所以当然是访问了非法地址咯。
结语
上面的分析是常规的流程,我也没啥经验,就当做给自己做个记录吧。也希望给遇到同样错误的同学提供一个思路方向。
————————————————
版权声明:本文为优快云博主「lee_jimmy」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/lee_jimmy/article/details/104031903