ARM linux 异常分析(一)-- __initt编译属性错误

linux 异常分析工具(一)

分析 :

    1. 调用dma_contiguous_early_fixup 后内核oops

   错误类型提示Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP ARM
   
   undefined instruction 意味着函数未定义,查看Sysmap 该函数是存在的。
   
   后面才发现问题出在函数的编译属性上: void __init dma_contiguous_early_fixup
   __init __init 宏最常用的地方是驱动模块初始化函数的定义处,其目的是将驱动模块的初始化函数放入名叫
   .init.text的输入段。当内核启动完毕后,这个段中的内存会被释放掉供其他使用。 因此第二次调用该函数后,text已经不存在,所以才会报错
   

[  240.570037] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP ARM
[  240.600068] CPU: 0    Tainted: G           O  (3.4.39 #17)
[  240.600068] PC is at dma_contiguous_early_fixup+0x4/0x2c
[  240.600068] LR is at cma_recreate_area+0x140/0x1c0
[  240.600068] pc : []    lr : []    psr: 20000013
[  240.600068] sp : d583ddd0  ip : 00000000  fp : d583dde4
[  240.600068] r10: 00000000  r9 : d583c000  r8 : c000e2e8
[  240.600068] r7 : 00000009  r6 : d45bd300  r5 : 00009400  r4 : d58ce700
[  240.600068] r3 : 0005d000  r2 : 00056000  r1 : 02400000  r0 : 5d000000
[  240.600068] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  240.600068] Control: 10c5387d  Table: 5442006a  DAC: 00000015
[  240.600068] 
[  240.600068] PC: 0xc08bce14:
[  240.600068] ce14  04050705 100f0f08 02010808 0e050738 0f400705 080f0607 0f03053d 05090503
[  240.600068] ce34  04030f03 112b4ac8 0d620f2d 04050510 0c0d0206 0c020315 16041c10 0a010110
[  240.600068] ce54  1129040b 05070302 0405100d 0d020603 0103150d 041c100c 16010e18 01112b04
[  240.600068] ce74  1d040504 0d080d0c 1607060b 1113070f 1207110e 120f040e 000f1206 3c000e00
[  240.600068] ce94  f600e8ff 1500d100 2e001b00 3f003300 53004f00 5b005700 63005f00 6d006700
[  240.600068] ceb4  00007300 070617b7 07061533 26071716 27070627 07273736 16173627 23373617
[  240.600068] ced4  33171627 07062315 35231533 23272633 17273335 16233733 23153317 23153315
[  240.600068] cef4  23353335 23153307 23153315 23352315 23353335 23353337 23353315 23153337
[  240.600068] 
[  240.600068] LR: 0xc032e944:
[  240.600068] e944  e1500003 ba000028 e30810d0 ebf76fdf e3500000 e584001c 1a000003 e59f10d0
[  240.600068] e964  e59f00d0 eb0c1fe8 ea00001f e59f00c8 eb0c3b50 e5941018 e5942020 e594001c
[  240.600068] e984  ebfd48e5 e594301c e5845004 e5845010 e5843014 e59f00a0 eb0c3ac5 e594300c
[  240.600068] e9a4  e5941010 e0511003 0a000004 e5942000 e1a01601 e0833002 e1a00603 eb163932
[  240.600068] e9c4  e5943010 e5941008 e0511003 01a00001 089da830 e5940000 e3a02000 e0830000
[  240.600068] e9e4  eb16925c e3500000 089da830 e59f4038 e5d43003 e3530001 0a000008 e59f002c
[  240.600068] ea04  e300111b ebf3e521 e3a03001 e3e00000 e5c43003 e89da830 e3e00015 e89da830
[  240.600068] ea24  e3e00000 e89da830 c0a273cc c0981ad6 c07befbc c06a74c8 c07befda c0953ff8
[  240.600068] 
[  240.600068] SP: 0xd583dd50:
[  240.600068] dd50  c032111c d44eab28 d59ab9c0 c031d634 c032111c c1844bc0 c08bce98 20000013
[  240.600068] dd70  c000df94 00000000 d583dde4 d583dd88 c000dcec c000820c 5d000000 02400000
[  240.600068] dd90  00056000 0005d000 d58ce700 00009400 d45bd300 00000009 c000e2e8 d583c000
[  240.600068] ddb0  00000000 d583dde4 00000000 d583ddd0 c032e9c4 c08bce94 20000013 ffffffff
[  240.600068] ddd0  be8cca10 be8cca14 d583dec4 d583dde8 c0323004 c032e890 d5a1df10 d583ded8
[  240.600068] ddf0  00000000 00000000 d583de14 d583de08 c012ae24 c012ac94 d583de2c d583de18
[  240.600068] de10  c0119254 c012adfc 00000000 d583ded8 d583de74 d583de30 c011d008 c0119238
[  240.600068] de30  d0aaa005 d5a1df10 d541e3c0 00000022 c011b534 d44eab28 d583de74 d583ded8
[  240.600068] 
[  240.600068] FP: 0xd583dd64:
[  240.600068] dd64  c1844bc0 c08bce98 20000013 c000df94 00000000 d583dde4 d583dd88 c000dcec
[  240.600068] dd84  c000820c 5d000000 02400000 00056000 0005d000 d58ce700 00009400 d45bd300
[  240.600068] dda4  00000009 c000e2e8 d583c000 00000000 d583dde4 00000000 d583ddd0 c032e9c4
[  240.600068] ddc4  c08bce94 20000013 ffffffff be8cca10 be8cca14 d583dec4 d583dde8 c0323004
[  240.600068] dde4  c032e890 d5a1df10 d583ded8 00000000 00000000 d583de14 d583de08 c012ae24
[  240.600068] de04  c012ac94 d583de2c d583de18 c0119254 c012adfc 00000000 d583ded8 d583de74
[  240.600068] de24  d583de30 c011d008 c0119238 d0aaa005 d5a1df10 d541e3c0 00000022 c011b534
[  240.600068] de44  d44eab28 d583de74 d583ded8 d583c000 ffffff9c d0aaa000 d583df60 d0aaa000
[  240.600068] 
[  240.600068] R4: 0xd58ce680:
[  240.600068] e680  d58ce9c0 d495c4c0 00000000 d5931000 00000006 00000005 00000000 00000002
[  240.600068] e6a0  00000002 00000003 ffffffff 00000005 00000006 ffffffff ffffffff 00000000
[  240.600068] e6c0  d58fcb40 d58ce6c4 d58ce6c4 d58cf208 00000000 c094794c d592d6c8 00000001
[  240.600068] e6e0  00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  240.600068] e700  00056000 00009400 0000a000 00007000 00009400 cc7b6000 d592f000 cc7b6000
[  240.600068] e720  00000e00 00000000 00000100 00000000 00000000 00000000 00000000 00000000
[  240.600068] e740  d58fcc40 d58ce744 d58ce744 d58ce900 00000000 c094794c d592d708 00000001
[  240.600068] e760  00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  240.600068] 
[  240.600068] R6: 0xd45bd280:
[  240.600068] d280  00002cf6 00100100 00200200 00000001 d49aec80 00000000 d0e96e00 c8509e80
[  240.600068] d2a0  00000000 00000001 e23000a4 5f444d50 00000010 00000000 00000000 00000000
[  240.600068] d2c0  bf05f000 bf094000 00000004 d0c0fdcd d45bd78c d4be340c d45bd798 d4be3418
[  240.600068] d2e0  0006ab5c 00001e02 d44b4580 00001e02 0006ab78 00001e02 0006ab86 00001e02
[  240.600068] d300  d2bf8900 00000000 00000000 d59ab9c0 00000000 00000001 00000000 00000000
[  240.600068] d320  d45bd320 d45bd320 00000000 c0797754 d583b9c0 00000001 d5578a20 00000000
[  240.600068] d340  6761742d 6c6c612f 6e6e6977 482f7265 38485f33 3038415f 6e75592f 2e32534f
[  240.600068] d360  2f302e32 34707362 322e342e 2d31312d 34366667 64643866 0006ac00 00001e02
[  240.600068] 
[  240.600068] R8: 0xc000e268:
[  240.600068] e268  e3570f5f e24fef7d 3798f107 e28d1008 e3a08000 e357080f e2270000 2a001327
[  240.600068] e288  ea00ee6c e24ee004 e58de03c eaffff79 e1a02007 e28d1008 e3a00000 eb000aac
[  240.600068] e2a8  e28fe014 e1a07000 e28d1008 e3570f5f 3891000f 3798f107 eaffffec e5ad0008
[  240.600068] e2c8  e1a02007 e1a0100d e3a00001 eb000aa0 eaffff80 e320f000 c09348c4 c000e99c
[  240.600068] e2e8  c003ba7c c002c908 c000e900 c010f694 c010f70c c010e8c0 c010d56c c0049c40
[  240.600068] e308  c010e910 c011dce4 c011dad0 c000e910 c010e220 c0049c40 c011d95c c010e490
[  240.600068] e328  c007b5cc c0049c40 c0049c40 c010f004 c0037a9c c012c9d4 c0049c40 c007b6b4
[  240.600068] e348  c007bb54 c0049c40 c0033fd4 c0049c40 c0049c40 c003cdc4 c0049c40 c0049c40
[  240.600068] 
[  240.600068] R9: 0xd583bf80:
[  240.600068] bf80  00000010 00040000 00000000 00000000 40408040 00000000 00000000 00400010
[  240.600068] bfa0  00000000 00000000 00400000 00000000 00000000 40001000 00000000 00000000
[  240.600068] bfc0  40001000 00000000 00000000 40004400 00000000 00000000 00040000 00000000
[  240.600068] bfe0  00000000 40000000 00000000 00000000 00040000 00000000 00000000 00000840
[  240.600068] c000  00000002 00000002 00000000 d583b9c0 c0935ec0 00000000 00000015 d583b9c0
[  240.600068] c020  c1217500 d583c000 00000000 c0933778 00000000 d4bf7e40 d583db1c d583da88
[  240.600068] c040  c063e6cc 00000000 00000000 00000000 00000000 00000000 01010000 00000000
[  240.600068] c060  0003b96c 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  240.600068] Process init (pid: 1, stack limit = 0xd583c2f8)
[  240.600068] Stack: (0xd583ddd0 to 0xd583e000)
[  240.600068] ddc0:                                     be8cca10 be8cca14 d583dec4 d583dde8
[  240.600068] dde0: c0323004 c032e890 d5a1df10 d583ded8 00000000 00000000 d583de14 d583de08
[  240.600068] de00: c012ae24 c012ac94 d583de2c d583de18 c0119254 c012adfc 00000000 d583ded8
[  240.600068] de20: d583de74 d583de30 c011d008 c0119238 d0aaa005 d5a1df10 d541e3c0 00000022
[  240.600068] de40: c011b534 d44eab28 d583de74 d583ded8 d583c000 ffffff9c d0aaa000 d583df60
[  240.600068] de60: d0aaa000 c011d574 d583decc d583de78 c011d574 c011d1e4 d583de9c c002f294
[  240.600068] de80: 00000076 00000000 d583dea4 d5a1df10 d564a118 c0057d34 d583debc 09400000
[  240.600068] dea0: c000f088 d59ab9c0 be8cca14 d45bd300 00000009 c000e2e8 d583df04 d583dec8
[  240.600068] dec0: c03223cc c0322c9c c0057d0c c007b56c d583def4 0000000b be8cca10 c007b56c
[  240.600068] dee0: 00000001 00000001 d44eab28 be8cca14 c1844bc0 00000009 d583df7c d583df08
[  240.600068] df00: c011fb58 c0321e84 60000013 d0aaa000 d583df44 d583df20 c0109e70 c02915f4
[  240.600068] df20: c092ccc4 00000009 c1844bc0 d0aaa000 00000020 d44eab28 d583df54 d583df48
[  240.600068] df40: c0119fe0 c0110c50 00000001 c1844bc0 d583df7c d583df60 c1844bc0 be8cca14
[  240.600068] df60: c0084906 00000009 c000e2e8 d583c000 d583dfa4 d583df80 c011fc14 c011f604
[  240.600068] df80: c000e2e8 00000001 be8ccbb0 00000094 be8ccb90 00000036 00000000 d583dfa8
[  240.600068] dfa0: c000e080 c011fbd8 be8ccbb0 00000094 00000009 c0084906 be8cca14 be8cc9f0
[  240.600068] dfc0: be8ccbb0 00000094 be8ccb90 00000036 00000000 00000000 00000000 0003a8c4
[  240.600068] dfe0: 0003b968 be8cc9e0 00025a1b 00029eec 20000010 00000009 00000000 00000000
[  240.600068] [] (cma_recreate_area+0x140/0x1c0) from [] (sunxi_ion_ioctl+0x374/0x3c8)
[  240.600068] [] (sunxi_ion_ioctl+0x374/0x3c8) from [] (ion_ioctl+0x554/0x5dc)
[  240.600068] [] (ion_ioctl+0x554/0x5dc) from [] (do_vfs_ioctl+0x560/0x5d4)
[  240.600068] [] (do_vfs_ioctl+0x560/0x5d4) from [] (sys_ioctl+0x48/0x6c)
[  240.600068] [] (sys_ioctl+0x48/0x6c) from [] (ret_fast_syscall+0x0/0x30)
[  240.600068] Code: 1207110e 120f040e 000f1206 3c000e00 (f600e8ff) 
root@dolphin_aliyun_p1:/ # [  241.552450] ---[ end trace a7cb2b6c83ce925e ]---
[  241.575882] Kernel panic - not syncing: Fatal exception
[  241.581865] CPU1: stopping
[  241.584896] [] (unwind_backtrace+0x0/0xec) from [] (dump_stack+0x20/0x24)
[  241.591792] [] (dump_stack+0x20/0x24) from [] (handle_IPI+0x17c/0x304)
[  241.591792] [] (handle_IPI+0x17c/0x304) from [] (gic_handle_irq+0x60/0x68)
[  241.591792] [] (gic_handle_irq+0x60/0x68) from [] (__irq_svc+0x40/0x70)
[  241.591792] Exception stack(0xd4a23de8 to 0xd4a23e30)
[  241.591792] 3de0:                   d2bf8ec0 600b0013 d4a23d88 00000000 d2bf8ec0 600b0013
[  241.591792] 3e00: 00000001 00000001 000000c3 00000000 d0c60230 d4a23e3c d4a23e40 d4a23e30
[  241.591792] 3e20: c005246c c063f488 600b0013 ffffffff
[  241.591792] [] (__irq_svc+0x40/0x70) from [] (_raw_spin_unlock_irqrestore+0x2c/0x54)
[  241.591792] [] (_raw_spin_unlock_irqrestore+0x2c/0x54) from [] (__wake_up_sync_key+0x5c/0x64)
[  241.591792] [] (__wake_up_sync_key+0x5c/0x64) from [] (sock_def_readable+0x58/0x80)
[  241.591792] [] (sock_def_readable+0x58/0x80) from [] (netlink_broadcast_filtered+0x2d4/0x3ec)
[  241.591792] [] (netlink_broadcast_filtered+0x2d4/0x3ec) from [] (kobject_uevent_env+0x2e4/0x434)
[  241.591792] [] (kobject_uevent_env+0x2e4/0x434) from [] (vsync_thread+0x74/0xb8)
[  241.591792] [] (vsync_thread+0x74/0xb8) from [] (kthread+0x9c/0xa8)
[  241.591792] [] (kthread+0x9c/0xa8) from [] (kernel_thread_exit+0x0/0x8)
[  241.736940] [hotplug]: cpu(0) try to kill cpu(1)
[  242.742216] [hotplug]: try to kill cpu:1 failed!
[  252.030012] ------------[ cut here ]------------
[  252.035143] WARNING: at kernel/watchdog.c:255 watchdog_timer_fn+0x118/0x2e4()
[  252.040004] Watchdog detected hard LOCKUP on cpu 1
[  252.040004] Modules linked in: snd_usb_audio snd_usbmidi_lib snd_hwdep sunxi_sndspdif sndspdif sunxi_spdma sunxi_spdif uvcvideo videobuf_dma_contig videobuf_core 8189fs yunos_multi_ir(O) bt_sleep yunos)
[  252.040004] [] (unwind_backtrace+0x0/0xec) from [] (dump_stack+0x20/0x24)
[  252.040004] [] (dump_stack+0x20/0x24) from [] (warn_slowpath_common+0x5c/0x74)
[  252.040004] [] (warn_slowpath_common+0x5c/0x74) from [] (warn_slowpath_fmt+0x40/0x48)
[  252.040004] [] (warn_slowpath_fmt+0x40/0x48) from [] (watchdog_timer_fn+0x118/0x2e4)
[  252.040004] [] (watchdog_timer_fn+0x118/0x2e4) from [] (__run_hrtimer+0x184/0x298)
[  252.040004] [] (__run_hrtimer+0x184/0x298) from [] (hrtimer_interrupt+0x12c/0x294)
[  252.040004] [] (hrtimer_interrupt+0x12c/0x294) from [] (arch_timer_handler+0x44/0x4c)
[  252.040004] [] (arch_timer_handler+0x44/0x4c) from [] (handle_percpu_devid_irq+0x128/0x1f4)
[  252.040004] [] (handle_percpu_devid_irq+0x128/0x1f4) from [] (generic_handle_irq+0x3c/0x50)
[  252.040004] [] (generic_handle_irq+0x3c/0x50) from [] (handle_IRQ+0x88/0xc8)
[  252.040004] [] (handle_IRQ+0x88/0xc8) from [] (gic_handle_irq+0x44/0x68)
[  252.040004] [] (gic_handle_irq+0x44/0x68) from [] (__irq_svc+0x40/0x70)
[  252.040004] Exception stack(0xd583dbb8 to 0xd583dc00)
[  252.040004] dba0:                                                       d583dc1c 00000000
[  252.040004] dbc0: 00000001 c0984848 d583dc1c 00005dbf 000024b8 00000013 c0947934 00000018
[  252.040004] dbe0: c0984e80 d583dc14 d583dc18 d583dc00 c0280098 c028003c a0030013 ffffffff
[  252.040004] [] (__irq_svc+0x40/0x70) from [] (read_current_timer+0x28/0x48)
[  252.040004] [] (read_current_timer+0x28/0x48) from [] (__timer_delay+0x3c/0x5c)
[  252.040004] [] (__timer_delay+0x3c/0x5c) from [] (__timer_const_udelay+0x2c/0x34)
[  252.040004] [] (__timer_const_udelay+0x2c/0x34) from [] (panic+0x1b4/0x1f0)
[  252.040004] [] (panic+0x1b4/0x1f0) from [] (die+0x2c8/0x334)
[  252.040004] [] (die+0x2c8/0x334) from [] (arm_notify_die+0x5c/0x60)
[  252.040004] [] (arm_notify_die+0x5c/0x60) from [] (do_undefinstr+0x184/0x1a8)
[  252.040004] [] (do_undefinstr+0x184/0x1a8) from [] (__und_svc_finish+0x0/0x14)
[  252.040004] Exception stack(0xd583dd88 to 0xd583ddd0)
[  252.040004] dd80:                   5d000000 02400000 00056000 0005d000 d58ce700 00009400
[  252.040004] dda0: d45bd300 00000009 c000e2e8 d583c000 00000000 d583dde4 00000000 d583ddd0
[  252.040004] ddc0: c032e9c4 c08bce94 20000013 ffffffff
[  252.040004] [] (__und_svc_finish+0x0/0x14) from [] (dma_contiguous_early_fixup+0x4/0x2c)
[  252.040004] ---[ end trace a7cb2b6c83ce925f ]---


你可能感兴趣的:(linux,异常情况调试与性能优化)