Linux内核Oops日志分析

oops报错信息:

[   34.335062] Unhandled fault: external abort on non-linefetch (0x1008) at 0xb4e6a407

[   34.345934] Internal error: : 1008 [#1] ARM

[   34.350108] Modules linked in: LongSungGobiNet hi3521a_adec(PO) hi3521a_aenc(PO) hi3521a_ao(PO) hi3521a_ai(PO) hi3521a_aio(PO) nvp6134_ex(O) hi3521a_ive(PO) hi3521a_vda(PO) hi3521a_jpege(PO) hi3521a_h264e(PO) hi3521a_chnl(PO) hi3521a_venc(PO) hi3521a_rc(PO) hifb(PO) hi3521a_vou(PO) hi3521a_vpss(PO) hi3521a_viu(PO) hi3521a_vgs(PO) hi3521a_region(PO) hi3521a_tde(PO) hi3521a_jpegd(O) hi3521a_vfmw(PO) hi3521a_vdec(PO) hi3521a_sys(PO) hi3521a_base(PO) hi_media(O) hiuser(O) hi_sd_detect mmz(O)

[   34.393360] CPU: 0 PID: 1385 Comm: wsd_capture Tainted: P           O 3.10.0 #13

[   34.400747] task: ce959180 ti: ce938000 task.ti: ce938000

[   34.406146] PC is at iov_iter_fault_in_readable+0x60/0x80

[   34.411538] LR is at generic_file_buffered_write+0x178/0x268

[   34.417190] pc : [<c0075cf4>]    lr : [<c0076a9c>]    psr: 20000013

[   34.417190] sp : ce939d98  ip : ce939ed0  fp : c03e5448

[   34.428656] r10: ce938000  r9 : 00001000  r8 : ce938020

[   34.433872] r7 : 00000000  r6 : 00001000  r5 : cf402d74  r4 : 00001000

[   34.440389] r3 : 00003000  r2 : b4e6a407  r1 : 00000000  r0 : 00000000

[   34.446909] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user

[   34.454034] Control: 10c53c7d  Table: 8e8f4059  DAC: 00000015

[   34.459770]

[   34.459770] PC: 0xc0075c74:

[   34.464031] 5c74  eaffffa5 e3e00000 eaffffa3 e92d4030 e591c034 e8bd4030 e59cc014 e12fff1c

[   34.472222] 5c94  e590c000 e5903008 e89c0005 e0632002 e0803003 e1510002 31a02001 e3520000

[   34.480410] 5cb4  0a000014 e24dd008 e3a00000 e4d31000 e3500000 e6ef1071 e5cd1007 1a00000b

[   34.488598] 5cd4  e2422001 e0832002 e0233002 e3c33eff e3c3300f e3530000 03a00000 0a000003

[   34.496786] 5cf4  e4d23000 e6ef3073 e5cd3007 e5dd3007 e28dd008 e12fff1e e3a00000 e12fff1e

[   34.504973] 5d14  e92d43f0 e5915000 e3550000 01a03005 0a000022 e5903004 e3530000 ba000024

[   34.513161] 5d34  e1a0e00d e3cecd7f e3ccc03f e590e000 e59c6008 e1a0c006 e09e4003 30d4400c

[   34.521350] 5d54  33a0c000 e35c0000 1a000017 e28cc001 e1a0e006 e15c0005 e2807008 0a00000f

[   34.529539]

[   34.529539] LR: 0xc0076a1c:

[   34.533800] 6a1c  eb0d9fc6 e28d0038 e1a01009 ebfffce8 e3590000 0a000047 e1cd21d0 e1a00005

[   34.541988] 6a3c  e0922009 e2a33000 e1cd21f0 eb001fd0 e59dc02c e59c200c e59dc01c e5921004

[   34.550176] 6a5c  e089c00c e58dc01c e5911000 e3110001 1a000020 e59d4044 e3540000 0a000021

[   34.558364] 6a7c  e59d3010 e7eb7053 e2676a01 e1560004 31a04006 e1a01004 e28d0038 ebfffc7d

[   34.566551] 6a9c  e1a01005 e1cd21d0 e3500000 e59d0020 1a000026 e59dc024 e58d4000 e58dc004

[   34.574739] 6abc  e28dc030 e58dc008 e28dc034 e58dc00c e59bc014 e12fff3c e2509000 1a000009

[   34.582927] 6adc  e5953010 e3530000 0affffad e59d0030 ebfe99dc eaffffaa e592228c e3120c01

[   34.591115] 6afc  0affffdb e3e09003 e59dc01c e35c0000 11a0900c e3590000 ba000007 e59dc080

[   34.599304]

[   34.599304] SP: 0xce939d18:

[   34.603565] 9d18  00000000 c07c8a00 cf4be000 00000000 00001000 c00c6244 c07c8a00 cf4be000

[   34.611753] 9d38  c0075cf4 20000013 ffffffff ce939d84 ce938020 c0012a18 00000000 00000000

[   34.619941] 9d58  b4e6a407 00003000 00001000 cf402d74 00001000 00000000 ce938020 00001000

[   34.628128] 9d78  ce938000 c03e5448 ce939ed0 ce939d98 c0076a9c c0075cf4 20000013 ffffffff

[   34.636316] 9d98  c03e5448 00076a4c 00001000 00001000 c07c8a00 38074300 00473000 00000000

[   34.644504] 9db8  00000010 0004e400 cfb7d840 00000000 ce938020 ce938000 c07c8a00 38074300

[   34.652691] 9dd8  ce939ed0 00000001 0004e400 00f50c00 5c6f54ee cf402cb8 ce939ef8 cfb7d840

[   34.660879] 9df8  00f9f000 ce939ed8 ce939ed0 cf402d74 00000000 c0078150 00424c00 00000000

[   34.669068]

[   34.669068] IP: 0xce939e50:

[   34.673329] 9e50  ce939e50 00f9f000 ce939e8c 00424c00 00000000 00424c00 00000000 ce939ed8

[   34.681516] 9e70  cfb7d840 00000001 ce939ed0 c00cd048 00000000 c01b6a94 00000000 91827364

[   34.689705] 9e90  ce939e90 ce939e90 ce939e98 ce939e98 000002a1 00424c00 00000000 00f9f000

[   34.697894] 9eb0  ce939f80 cfb7d840 ce959180 00000000 00000f9f c00a176c 00424c00 00000000

[   34.706081] 9ed0  b4e1b008 00f9f000 00000001 cfb7d840 00000000 00000000 00000000 ce959180

[   34.714270] 9ef0  00000000 00000000 00424c00 00000000 00000000 00000000 00f9f000 00000000

[   34.722457] 9f10  00f9f000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.730644] 9f30  00000000 00000000 00000029 cfb7d840 b4e1b008 ce939f80 00f9f000 00000001

[   34.738833]

[   34.738833] FP: 0xc03e53c8:

[   34.743094] 53c8  c00c2694 c00c28bc c00a7e6c 65697571 72655f74 00726f72 776f7267 6675625f

[   34.751282] 53e8  73726566 00000000 c00cca54 c00cca30 00000000 00000000 c00b58cc c00cc9a8

[   34.759469] 5408  00000000 00000000 00000000 00000000 c00bf260 00000000 00000000 00000000

[   34.767657] 5428  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.775843] 5448  c00ccd04 c00cccf4 c007e0b4 00000000 00000000 c00cccd8 c00ccc90 00000000

[   34.784031] 5468  00000000 c00ccc3c 00000000 c00ccbe4 00000000 00000000 00000000 00000000

[   34.792218] 5488  00000000 00000000 00000000 00000000 c00cc808 c00a1654 c00a16f4 c00cd118

[   34.800404] 54a8  c00cd000 00000000 00000000 c00cd0ac 00000000 c0076750 c00cdf44 00000000

[   34.808595]

[   34.808595] R5: 0xcf402cf4:

[   34.812855] 2cf4  00000000 00000000 00000000 00000000 00000000 00000000 0000000c 00000000

[   34.821043] 2d14  00000000 00000004 00000001 cf402d20 cf402d20 ffff9821 00000000 c082769c

[   34.829231] 2d34  cfa5d8e0 cfa5d8e0 cf402d3c cf402d3c cf402b84 cf402f04 00000000 00000000

[   34.837418] 2d54  00000000 00000000 00000000 00000002 00000000 00000000 c05dacc0 00000000

[   34.845605] 2d74  cf402cb8 00000002 02000020 cf4e4261 00000000 00000000 cf402d8c cf402d8c

[   34.853792] 2d94  00000001 cf402d98 cf402d98 00000075 00000000 c03e5448 000200d0 cfa5d820

[   34.861981] 2db4  cf402db4 cf402db4 00000000 00000000 00000000 cf402dc8 cf402dc8 cf402c40

[   34.870168] 2dd4  00000000 00000000 00000000 00000000 00000000 cf402e00 02e5de6d 6bf68cb4

[   34.878357]

[   34.878357] R8: 0xce937fa0:

[   34.882618] 7fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.890804] 7fc0  00000000 b6528e58 00000000 000000a2 000129e8 01de65e8 00000000 b652a024

[   34.898992] 7fe0  00000000 b6528e48 b652a4c0 b6d3def8 80000010 b6528e58 00000000 00000000

[   34.907179] 8000  00000000 00000001 00000000 ce959180 c0592bcc 00000000 00000015 ce959180

[   34.915366] 8020  c0594ae8 cfaa3780 c0594ae8 cf90fc00 c03e3550 00000000 ce939ca4 ce939c10

[   34.923554] 8040  c03de538 00000000 00000000 00000000 00000000 00000000 01010000 00000000

[   34.931740] 8060  b5e6a950 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.939927] 8080  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.948114]

[   34.948114] R10: 0xce937f80:

[   34.952462] 7f80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.960648] 7fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   34.968834] 7fc0  00000000 b6528e58 00000000 000000a2 000129e8 01de65e8 00000000 b652a024

[   34.977021] 7fe0  00000000 b6528e48 b652a4c0 b6d3def8 80000010 b6528e58 00000000 00000000

[   34.985208] 8000  00000000 00000001 00000000 ce959180 c0592bcc 00000000 00000015 ce959180

[   34.993395] 8020  c0594ae8 cfaa3780 c0594ae8 cf90fc00 c03e3550 00000000 ce939ca4 ce939c10

[   35.001584] 8040  c03de538 00000000 00000000 00000000 00000000 00000000 01010000 00000000

[   35.009770] 8060  b5e6a950 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   35.017961] Process wsd_capture (pid: 1385, stack limit = 0xce938230)

[   35.024391] Stack: (0xce939d98 to 0xce93a000)

[   35.028742] 9d80:                                                       c03e5448 00076a4c

[   35.036914] 9da0: 00001000 00001000 c07c8a00 38074300 00473000 00000000 00000010 0004e400

[   35.045086] 9dc0: cfb7d840 00000000 ce938020 ce938000 c07c8a00 38074300 ce939ed0 00000001

[   35.053258] 9de0: 0004e400 00f50c00 5c6f54ee cf402cb8 ce939ef8 cfb7d840 00f9f000 ce939ed8

[   35.061429] 9e00: ce939ed0 cf402d74 00000000 c0078150 00424c00 00000000 ce939ef8 00f9f000

[   35.069600] 9e20: 00000000 00000000 ce939e28 ce939e28 00000001 ce938010 00424c00 00000000

[   35.077771] 9e40: 00000001 c00cc964 ce939e48 00000001 ce939e50 00f9f000 ce939e8c 00424c00

[   35.085942] 9e60: 00000000 00424c00 00000000 ce939ed8 cfb7d840 00000001 ce939ed0 c00cd048

[   35.094114] 9e80: 00000000 c01b6a94 00000000 91827364 ce939e90 ce939e90 ce939e98 ce939e98

[   35.102285] 9ea0: 000002a1 00424c00 00000000 00f9f000 ce939f80 cfb7d840 ce959180 00000000

[   35.110456] 9ec0: 00000f9f c00a176c 00424c00 00000000 b4e1b008 00f9f000 00000001 cfb7d840

[   35.118628] 9ee0: 00000000 00000000 00000000 ce959180 00000000 00000000 00424c00 00000000

[   35.126798] 9f00: 00000000 00000000 00f9f000 00000000 00f9f000 00000000 00000000 00000000

[   35.134969] 9f20: 00000000 00000000 00000000 00000000 00000000 00000000 00000029 cfb7d840

[   35.143140] 9f40: b4e1b008 ce939f80 00f9f000 00000001 00f9f000 c00a1e28 00000000 00000001

[   35.151312] 9f60: b5e69cb8 00424c00 00000000 cfb7d840 b4e1b008 00000001 00f9f000 c00a23a0

[   35.159483] 9f80: 00424c00 00000000 00000000 00424c00 00000000 00000000 00000004 c0012fe8

[   35.167654] 9fa0: ce938000 c0012e40 00424c00 00000000 0000000d b4e1b008 00f9f000 00f9f000

[   35.175826] 9fc0: 00424c00 00000000 00000000 00000004 0000000d 00000041 00002126 00000f9f

[   35.183997] 9fe0: 00000000 b5e69cc0 b5e6a4c0 b5ec3e14 80000010 0000000d ffffffff ffffffff

[ 35.192181] [<c0075cf4>] (iov_iter_fault_in_readable+0x60/0x80) from [<c0076a9c>] (generic_file_buffered_write+0x178/0x268)

[35.203310] [<c0076a9c>] (generic_file_buffered_write+0x178/0x268) from [<c0078150>] (__generic_file_aio_write+0x1d8/0x400)

[35.214435] [<c0078150>] (__generic_file_aio_write+0x1d8/0x400) from [<c00cd048>] (blkdev_aio_write+0x48/0xac)

[35.224435] [<c00cd048>] (blkdev_aio_write+0x48/0xac) from [<c00a176c>] (do_sync_write+0x78/0xa0)

[   35.233305] [<c00a176c>] (do_sync_write+0x78/0xa0) from [<c00a1e28>] (vfs_write+0xb4/0x194)

[   35.241654] [<c00a1e28>] (vfs_write+0xb4/0x194) from [<c00a23a0>] (SyS_write+0x3c/0x78)

[  35.249658] [<c00a23a0>] (SyS_write+0x3c/0x78) from [<c0012e40>] (ret_fast_syscall+0x0/0x30)

[   35.258091] Code: e3c3300f e3530000 03a00000 0a000003 (e4d23000)

[   35.264176] ---[ end trace 086cb874698f7a51 ]---

 

 

 

分析过程关注点:

出错时的寄存器快照: pc : [<c0075cf4>] (很重要)

Linux内核Oops日志分析

 

出错时的进程:注意有可能是用户态或者是内核态

Linux内核Oops日志分析

 

调用过程:

Linux内核Oops日志分析

错误类型:

Unhandled fault: external abort on non-linefetch (0x1008) at 0xb4e6a407

当时模块加载的情况:

Modules linked in:Modules linked in: LongSungGobiNet hi3521a_adec(PO) hi3521a_aenc(PO) hi3521a_ao(PO) hi3521a_ai(PO) hi3521a_aio(PO) nvp6134_ex(O) hi3521a_ive(PO) hi3521a_vda(PO) hi3521a_jpege(PO) hi3521a_h264e(PO) hi3521a_chnl(PO) hi3521a_venc(PO) hi3521a_rc(PO) hifb(PO) hi3521a_vou(PO) hi3521a_vpss(PO) hi3521a_viu(PO) hi3521a_vgs(PO) hi3521a_region(PO) hi3521a_tde(PO) hi3521a_jpegd(O) hi3521a_vfmw(PO) hi3521a_vdec(PO) hi3521a_sys(PO) hi3521a_base(PO) hi_media(O) hiuser(O) hi_sd_detect mmz(O)

/对应的模块的内存空间:cat /proc/modules

Linux内核Oops日志分析

当然这个错误不是发生在模块上。

 

接着内核查找:PC指针的地址:0xc0075cf4

 arm-hisiv300-linux-objdump -D vmlinux > vmlinux.dis

Linux内核Oops日志分析

 

是不是与上面的错误日志很像?

[<c0075cf4>] (iov_iter_fault_in_readable+0x60/0x80) from [<c0076a9c>] (generic_file_buffered_write+0x178/0x268)

表示出错指令为 iov_iter_fault_in_readable 函数中偏移为0x60的指令。
"pc : [<c0075cf4>] "表示出错指令的地址为 c0075cf4(十六进制)。

Linux内核Oops日志分析

 

意思是把R2指向的内容赋值给R3,R3高24字节清0。R2为0xb4e6a407。是不是也很熟悉?

Linux内核Oops日志分析

arm-hisiv300-linux-readelf -a wsd_capture > wsd_capture.elf

Linux内核Oops日志分析

没有相关地址,接着查找库文件