kernel里调试时写alc5642时机器会时而重启,终于抓到了log,如下:
Unable to handle kernel paging request at virtual address xxxx
网上一搜,如下:
Restarting system.
Unable to handle kernel paging request at virtual address b13bffe0
pgd = c9184000
[b13bffe0] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP
last sysfs file:
Modules linked in: [last unloaded: scsi_wait_scan]
CPU: 0 Not tainted (2.6.32.24-arm-r1.0.0a3 #1)
PC is at free_block+0xa4/0x180
LR is at drain_array+0xac/0xd4
pc : [<800ae21c>] lr : [<800ae3a4>] psr: 20000093
sp : c8e59ec8 ip : fff7e7ff fp : c8e59f0c
r10: 00000014 r9 : b2404000 r8 : 000147ff
r7 : 00200200 r6 : 8039115c r5 : 00000002 r4 : c8e03f00
r3 : fff7ddff r2 : fddfffff r1 : 147fffff r0 : 145fffff
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c53c7d Table: dfb8404a DAC: 00000017
Process events/0 (pid: 9, stack limit = 0xc8e582f8)
Stack: (0xc8e59ec8 to 0xc8e5a000)
9ec0: 00100100 c8e1c818 c8e59efc 00000060 000002a0 00000015
9ee0: 000001e0 c8e1c800 c8e111a4 00000060 c8e1c818 c8e03f00 b2d3d660 80368080
9f00: c8e59f34 c8e59f10 800ae3a4 800ae184 00000000 c8e03f00 c8e11180 00000000
9f20: 80391ba8 80368080 c8e59f6c c8e59f38 800ae600 800ae304 00000000 800420cc
9f40: c8e59fc4 b2d3fde0 b2d3fde0 c8e58000 800ae534 b2d3fde8 b2d3d660 00000000
9f60: c8e59fbc c8e59f70 8005e218 800ae540 80000013 b2d3fdf0 80375d40 00000000
9f80: c8e30040 80062628 c8e59f88 c8e59f88 8003d0f4 c8e41ef0 00000002 8005e10c
9fa0: b2d3fde0 00000000 00000000 00000000 c8e59ff4 c8e59fc0 800623cc 8005e118
9fc0: 00000000 00000000 00000000 00000000 c8e59fd0 c8e59fd0 00000000 00000000
9fe0: 00000000 00000000 00000000 c8e59ff8 8004e8f0 80062350 00000000 00000000
Backtrace:
[<800ae178>] (free_block+0x0/0x180) from [<800ae3a4>] (drain_array+0xac/0xd4)
[<800ae2f8>] (drain_array+0x0/0xd4) from [<800ae600>] (cache_reap+0xcc/0x148)
r8:80368080 r7:80391ba8 r6:00000000 r5:c8e11180 r4:c8e03f00
r3:00000000
[<800ae534>] (cache_reap+0x0/0x148) from [<8005e218>] (worker_thread+0x10c/0x1ac)
[<8005e10c>] (worker_thread+0x0/0x1ac) from [<800623cc>] (kthread+0x88/0x90)
[<80062344>] (kthread+0x0/0x90) from [<8004e8f0>] (do_exit+0x0/0x6a0)
r7:00000000 r6:00000000 r5:00000000 r4:00000000
Code: e2801602 e1a08621 e248ca96 e24c3c0a (e7990283)
---[ end trace 9c279a318fb054ae ]---
note: events/0[9] exited with preempt_count 1
-------------------------------------------------------------------------------------
Oops Messages
Oops 消息
Most bugs show themselves in NULL pointer dereferences or by the use of other incorrect pointer values. The usual outcome of such bugs is an oops message.
大多数bug通常是因为废弃了一个NULL指针或者使用了错误的指针值。这类bug导致的结果通常是一条oops消息。
经查确实是打印一个str时(%s),str里没有‘\0‘引起的,改后就ok了。