- 论坛徽章:
- 0
|
本帖最后由 king_208 于 2014-11-27 17:35 编辑
Hi all,
最近遇到一个kernel panic的问题,困扰了很久,恳请大神解惑,谢谢!
我的环境是ARM CA7单核,Linux3.10.
我加了一些打印,发现出错的地方在mm/slub.c的get_freepointer函数里(Unable to handle kernel paging request at virtual address ffffffe0)
于是跟踪了一下调用它的地方,最终发现在函数slab_alloc_node里:
static __always_inline void *slab_alloc_node(struct kmem_cache *s,
gfp_t gfpflags, int node, unsigned long addr)
{
......
preempt_disable();
c = __this_cpu_ptr(s->cpu_slab);
/*
* The transaction ids are globally unique per cpu and per operation on
* a per cpu queue. Thus they can be guarantee that the cmpxchg_double
* occurs on the right processor and that there was no operation on the
* linked list in between.
*/
tid = c->tid;
preempt_enable();
object = c->freelist; --> 此处object = ffffffe0,和oops时打出的值一样
page = c->page;
if (unlikely(!object || !node_match(page, node)))
object = __slab_alloc(s, gfpflags, node, addr, c);
else {
void *next_object = get_freepointer_safe(s, object); -->此处调用get_freepointer导致出错,因为object已经是个不正确的值了
......
}
问题是,究竟什么样的操作会导致这个结果呢?有人重复释放同一内存?内存不够用了?
坐等大神解惑,谢谢了!
下面是错误的log:
[ 81.657196] initialize 1 instancesInitialized 1 portsandroid_usb gadget: Mass Storage Function, version: 2009/09/11
[ 81.672119] android_usb gadget: Number of LUNs=1
[ 81.704742] lun0: LUN: removable file: (no medium)
[ 81.716278] android_usb gadget: android_usb ready
[ 81.721069] mv-udc mv-udc: usb vbus is off
[ 81.742797] @@@@ mv_power_off_work 198
[ 81.746887] mbim_handle_function_bind_config MAC: 00:00:00:00:00:00
[ 81.753265] android_usb gadget: using random self ethernet address
[ 81.794738] android_usb gadget: using random host ethernet address
[ 81.806549] Unable to handle kernel paging request at virtual address ffffffe0
[ 81.814270] usbnet0: MAC 92:9d:71:5d:d3:ec
[ 81.820465] Unable to handle kernel paging request at virtual address ffffffe0
[ 81.834625] usbnet0: HOST MAC 5e:3d:c8:10:2c:eb
[ 81.839233] super speed IN/ep1in OUT/ep1out NOTIFY/ep2in[ 81.844451] pgd = c15d4000
[ 81.847473] [ffffffe0] *pgd=05ffd821, *pte=00000000, *ppte=00000000
[ 81.853942] Internal error: Oops: 17 [#1] PREEMPT ARM
[ 81.859008] Modules linked in: seh iml_module gs_modem cploaddev cidatattydev ccinetdev cci_datastub audiostub xt_multiport xt_id xt_TCPMSS xt_REDIRECT xt_LOG xt_CT msocketk ipt_MASQUERADE hwmap fastpath citty gpio_button_hotplug
[ 81.879364] CPU: 0 PID: 627 Comm: netifd Not tainted 3.10.33 #53
[ 81.885375] task: c1c48300 ti: c1ea4000 task.ti: c1ea4000
[ 81.890777] PC is at kmem_cache_alloc+0x88/0x108
[ 81.895385] LR is at ipv6_add_dev+0x50/0x3b4
[ 81.899658] pc : [<c019dd30>] lr : [<c04ed038>] psr: a0000013
[ 81.899658] sp : c1ea5e28 ip : c0759520 fp : c04ed038
[ 81.911132] r10: 00001d73 r9 : c1ea4028 r8 : 000080d0
[ 81.916351] r7 : c1ea4000 r6 : c1ea4028 r5 : ffffffe0 r4 : c1801d00
[ 81.922882] r3 : 00000000 r2 : c1ba2000 r1 : 000080d0 r0 : c1801d00
[ 81.929382] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 81.936523] Control: 10c53c7d Table: 055d4059 DAC: 00000015
[ 81.942260]
[ 81.942260] PC: 0xc019dcb0:
[ 81.946533] dcb0 e3c36d7f e1a0b00e e3c6703f e1a04000 e1a08001 e1a09006 e3c6603f e5963004
[ 81.954711] dcd0 e2833001 e5863004 e5945000 e595a004 e5973004 e2433001 e5873004 e5973000
[ 81.962890] dcf0 e1a06009 e3130002 0a000000 ebfdc985 e5955000 e3550000 1a000007 e1a0200b
[ 81.971069] dd10 e1a00004 e1a01008 ebfffdeb e3180902 e1a05000 0a00001f ea000017 e5943014
[ 81.979248] dd30 e7951003 e10f0000 f10c0080 e5942000 e3a03000 e592c000 e155000c 1a000006
[ 81.987426] dd50 e592c004 e15a000c 05821000 028aa001 05942000 03a03001 0582a004 e121f000
[ 81.995605] dd70 e3530000 0affffd3 e5943014 f7d1f003 e3180902 0a000007 ea000001 e3500000
[ 82.003784] dd90 0a000004 e5941010 e3510000 0a000001 e1a00005 ebfdba25 e1a00005 e8bd8ff8
[ 82.011962]
[ 82.011962] LR: 0xc04ecfb8:
[ 82.016204] cfb8 e59410c0 e34c206a e34c304f e5900000 ebfd44de e1a03004 e30602e0 e1a02004
[ 82.024383] cfd8 e49310c8 e34c0075 e8bd4010 eaffffbf e92d40f8 e1a05000 ebfd52cb e3500000
[ 82.032562] cff8 1a000006 e3050a90 e30f1c1c e34c1069 e300215d e34c0069 ebf0e875 ebf76f95
[ 82.040740] d018 e5953104 e3530c05 3a0000d2 e30d66ac e30810d0 e34c607c e5960024 ebf2c31b
[ 82.048919] d038 e2504000 0a0000cb e30f1cb0 e30a2018 e34c1069 e34c2077 e284006c ebf7b0ce
[ 82.057098] d058 e30612e0 e1a03004 e34c1075 e4835004 e3a02080 e5843004 e28400c8 e5843008
[ 82.065277] d078 e5911224 ebf07b97 e5953104 e3001574 e3a02000 e34c1076 e5842144 e58430d0
[ 82.073455] d098 e1a00005 ebfd519b e3500000 e1a07000 e58400c0 1a000003 e1a00004 ebf2c4a5
[ 82.081634]
[ 82.081634] SP: 0xc1ea5da8:
[ 82.085906] 5da8 c1b99bac c01ec6a4 c1efe778 c07562e0 c1bf2e00 fffffffe c07562e0 00000000
[ 82.094055] 5dc8 c019dd30 a0000013 ffffffff c1ea5e14 000080d0 c0108c58 c1801d00 000080d0
[ 82.102233] 5de8 c1ba2000 00000000 c1801d00 ffffffe0 c1ea4028 c1ea4000 000080d0 c1ea4028
[ 82.110412] 5e08 00001d73 c04ed038 c0759520 c1ea5e28 c04ed038 c019dd30 a0000013 ffffffff
[ 82.118591] 5e28 000005dc c1ba2000 c1ba2000 c07cd6ac c1ba2000 00000005 c07562e0 40004800
[ 82.126770] 5e48 00000000 c04ed038 000005dc c1ba2000 00000005 00000000 c1ba2000 c04f2af8
[ 82.134918] 5e68 fffffff1 00000000 c0764978 c0146174 00000000 00000000 40ff48e9 00000000
[ 82.143096] 5e88 c1ba2000 c0146244 00000000 00000000 00000000 c0438808 c1c48300 c1ba2000
[ 82.151275]
[ 82.151275] IP: 0xc07594a0:
[ 82.155548] 94a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.163726] 94c0 00000000 00000000 00000000 c072a434 c010d9a8 00000000 00000000 00000000
[ 82.171905] 94e0 00000000 00000001 c1b3d740 bf01dbc0 c051c448 00000000 0000000a 00000000
[ 82.180053] 9500 fffffe70 c1b3d75c c0741010 c051c448 00000000 0000000a 00000003 fffffe70
[ 82.188232] 9520 c04f2a80 c0764978 00000000 c06a0960 c07564f8 00000004 000001a4 00000000
[ 82.196411] 9540 c012e6a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.204589] 9560 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c072a6f8
[ 82.212768] 9580 c010da9c 00000000 00000000 00000000 00000000 00000000 c051bbf4 c051bbac
[ 82.220947]
[ 82.220947] FP: 0xc04ecfb8:
[ 82.225189] cfb8 e59410c0 e34c206a e34c304f e5900000 ebfd44de e1a03004 e30602e0 e1a02004
[ 82.233367] cfd8 e49310c8 e34c0075 e8bd4010 eaffffbf e92d40f8 e1a05000 ebfd52cb e3500000
[ 82.241546] cff8 1a000006 e3050a90 e30f1c1c e34c1069 e300215d e34c0069 ebf0e875 ebf76f95
[ 82.249694] d018 e5953104 e3530c05 3a0000d2 e30d66ac e30810d0 e34c607c e5960024 ebf2c31b
[ 82.257873] d038 e2504000 0a0000cb e30f1cb0 e30a2018 e34c1069 e34c2077 e284006c ebf7b0ce
[ 82.266052] d058 e30612e0 e1a03004 e34c1075 e4835004 e3a02080 e5843004 e28400c8 e5843008
[ 82.274230] d078 e5911224 ebf07b97 e5953104 e3001574 e3a02000 e34c1076 e5842144 e58430d0
[ 82.282409] d098 e1a00005 ebfd519b e3500000 e1a07000 e58400c0 1a000003 e1a00004 ebf2c4a5
[ 82.290588]
[ 82.290588] R0: 0xc1801c80:
[ 82.294860] 1c80 c008a070 00000000 00000005 00000400 00000400 00000000 00000006 00010008
[ 82.303009] 1ca0 00010008 00000004 00004000 00000002 00000000 00000400 00000040 00000000
[ 82.311187] 1cc0 c1802140 c1801d44 c1801c44 c19ab000 c1801d50 c1801c50 c1992358 c1992340
[ 82.319366] 1ce0 c076d6f0 c19ab080 00000001 00000007 c1800e80 55555555 55555555 55555555
[ 82.327545] 1d00 c008a060 00000000 00000005 00000200 00000200 00000000 0000000d 00000008
[ 82.335723] 1d20 00000008 00000008 00000000 00000002 00000000 00000200 00000040 00000000
[ 82.343902] 1d40 c1802100 c1801dc4 c1801cc4 c19ab8c0 c1801dd0 c1801cd0 c1992358 c1992340
[ 82.352081] 1d60 c076d6f0 c19ab940 00000001 00000007 c1800ec0 55555555 55555555 55555555
[ 82.360260]
[ 82.360260] R2: 0xc1ba1f80:
[ 82.364501] 1f80 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.372680] 1fa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.380859] 1fc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.389038] 1fe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.397216] 2000 6c2d7262 00006e61 00000000 00000000 00000000 c19167a4 00000000 00000000
[ 82.405364] 2020 00000000 00000000 00000000 00000002 c0756358 c0ce4030 c1ba2038 c1ba2038
[ 82.413543] 2040 c1ba2040 c1ba2040 c1ba2048 c1ba2048 40ff78e9 00000000 40ff48e9 00000000
[ 82.421722] 2060 40ff48e9 00000000 00000020 00000000 00000001 00000000 00000013 00000013
[ 82.429901]
[ 82.429901] R4: 0xc1801c80:
[ 82.434173] 1c80 c008a070 00000000 00000005 00000400 00000400 00000000 00000006 00010008
[ 82.442352] 1ca0 00010008 00000004 00004000 00000002 00000000 00000400 00000040 00000000
[ 82.450531] 1cc0 c1802140 c1801d44 c1801c44 c19ab000 c1801d50 c1801c50 c1992358 c1992340
[ 82.458709] 1ce0 c076d6f0 c19ab080 00000001 00000007 c1800e80 55555555 55555555 55555555
[ 82.466857] 1d00 c008a060 00000000 00000005 00000200 00000200 00000000 0000000d 00000008
[ 82.475067] 1d20 00000008 00000008 00000000 00000002 00000000 00000200 00000040 00000000
[ 82.483245] 1d40 c1802100 c1801dc4 c1801cc4 c19ab8c0 c1801dd0 c1801cd0 c1992358 c1992340
[ 82.491394] 1d60 c076d6f0 c19ab940 00000001 00000007 c1800ec0 55555555 55555555 55555555
[ 82.499572]
[ 82.499572] R6: 0xc1ea3fa8:
[ 82.503845] 3fa8 00062dd0 00000100 0006ef90 00000000 00000124 00000019 5f504d4d 52414f42
[ 82.512023] 3fc8 414e5f44 003d454d 00000124 00000019 00062e70 00000000 0006aeb8 00000000
[ 82.520202] 3fe8 00000018 00000029 00000000 000706d0 00000001 69616600 00000000 00000001
[ 82.528381] 4008 00000000 c1c48300 c074f0cc 00000000 00000015 c1c48300 c0747100 c07cfcd0
[ 82.536560] 4028 c1c48c00 c1ea4028 0323ad3c 00000000 c1ea5c1c c1ea5be8 c011009c 00000000
[ 82.544738] 4048 00000000 00000000 00000000 00000000 01010000 00000000 b6f20740 00000000
[ 82.552917] 4068 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.561065] 4088 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.569244]
[ 82.569244] R7: 0xc1ea3f80:
[ 82.573516] 3f80 00000004 00068fa8 74736574 00000019 525f4950 645f4e41 78705f6f 78383161
[ 82.581695] 3fa0 00313d78 00000019 00062dd0 00000100 0006ef90 00000000 00000124 00000019
[ 82.589874] 3fc0 5f504d4d 52414f42 414e5f44 003d454d 00000124 00000019 00062e70 00000000
[ 82.598052] 3fe0 0006aeb8 00000000 00000018 00000029 00000000 000706d0 00000001 69616600
[ 82.606231] 4000 00000000 00000001 00000000 c1c48300 c074f0cc 00000000 00000015 c1c48300
[ 82.614379] 4020 c0747100 c07cfcd0 c1c48c00 c1ea4028 0323ad3c 00000000 c1ea5c1c c1ea5be8
[ 82.622558] 4040 c011009c 00000000 00000000 00000000 00000000 00000000 01010000 00000000
[ 82.630737] 4060 b6f20740 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.638916]
[ 82.638916] R9: 0xc1ea3fa8:
[ 82.643188] 3fa8 00062dd0 00000100 0006ef90 00000000 00000124 00000019 5f504d4d 52414f42
[ 82.651367] 3fc8 414e5f44 003d454d 00000124 00000019 00062e70 00000000 0006aeb8 00000000
[ 82.659545] 3fe8 00000018 00000029 00000000 000706d0 00000001 69616600 00000000 00000001
[ 82.667724] 4008 00000000 c1c48300 c074f0cc 00000000 00000015 c1c48300 c0747100 c07cfcd0
[ 82.675903] 4028 c1c48c00 c1ea4028 0323ad3c 00000000 c1ea5c1c c1ea5be8 c011009c 00000000
[ 82.684082] 4048 00000000 00000000 00000000 00000000 01010000 00000000 b6f20740 00000000
[ 82.692230] 4068 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.700408] 4088 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 82.708587] Process netifd (pid: 627, stack limit = 0xc1ea423
[ 82.714508] Stack: (0xc1ea5e28 to 0xc1ea6000)
[ 82.718841] 5e20: 000005dc c1ba2000 c1ba2000 c07cd6ac c1ba2000 00000005
[ 82.727020] 5e40: c07562e0 40004800 00000000 c04ed038 000005dc c1ba2000 00000005 00000000
[ 82.735198] 5e60: c1ba2000 c04f2af8 fffffff1 00000000 c0764978 c0146174 00000000 00000000
[ 82.743377] 5e80: 40ff48e9 00000000 c1ba2000 c0146244 00000000 00000000 00000000 c0438808
[ 82.751556] 5ea0: c1c48300 c1ba2000 00039c30 c07562e0 00039c30 c0c5dcc0 c1ea4000 00000000
[ 82.759735] 5ec0: 00000012 c04388c8 c1ba2000 c0534778 00000001 c1ea5ef8 00000010 000089a0
[ 82.767913] 5ee0: 00039c30 c0535c58 c1e2b000 c074cbe4 00039c30 c079be54 6c2d7262 00006e61
[ 82.776092] 5f00: 00000000 00000000 000089a0 00039c30 c079be54 c04251b8 00000000 c0c5dcc0
[ 82.784271] 5f20: c00e0020 c01b21d4 05c81a40 c01a6d2c c1ea5f50 c1393ba8 becb0b38 00048352
[ 82.792449] 5f40: 00000001 000000c3 c0109244 c01a73e4 00000129 c0109244 c1ea4000 00000000
[ 82.800628] 5f60: b6f152e0 00000000 00039c30 000089a0 00000006 c0c5dcc0 c1ea4000 00000000
[ 82.808807] 5f80: 00000012 c01b2258 00000001 00000000 00039c30 000089a0 00000001 00000036
[ 82.816986] 5fa0: c0109244 c01090c0 00039c30 000089a0 00000006 000089a0 00039c30 00000000
[ 82.825164] 5fc0: 00039c30 000089a0 00000001 00000036 becb0bc0 00027d70 00000000 00000012
[ 82.833343] 5fe0: 00027140 becb0b00 0001ab88 b6e6ac9c 60000010 00000006 00000000 00000000
[ 82.841522] [<c019dd30>] (kmem_cache_alloc+0x88/0x10 from [<c04ed038>] (ipv6_add_dev+0x50/0x3b4)
[ 82.850494] [<c04ed038>] (ipv6_add_dev+0x50/0x3b4) from [<c04f2af8>] (addrconf_notify+0x78/0x31c)
[ 82.859374] [<c04f2af8>] (addrconf_notify+0x78/0x31c) from [<c0146174>] (notifier_call_chain+0x2c/0x70)
[ 82.868774] [<c0146174>] (notifier_call_chain+0x2c/0x70) from [<c0146244>] (raw_notifier_call_chain+0x18/0x20)
[ 82.878784] [<c0146244>] (raw_notifier_call_chain+0x18/0x20) from [<c0438808>] (register_netdevice+0x3f0/0x49c)
[ 82.888885] [<c0438808>] (register_netdevice+0x3f0/0x49c) from [<c04388c8>] (register_netdev+0x14/0x24)
[ 82.898284] [<c04388c8>] (register_netdev+0x14/0x24) from [<c0534778>] (br_add_bridge+0x38/0x60)
[ 82.907073] [<c0534778>] (br_add_bridge+0x38/0x60) from [<c0535c58>] (br_ioctl_deviceless_stub+0x268/0x28
[ 82.916839] [<c0535c58>] (br_ioctl_deviceless_stub+0x268/0x28 from [<c04251b8>] (sock_ioctl+0x170/0x29
[ 82.926483] [<c04251b8>] (sock_ioctl+0x170/0x29 from [<c01b21d4>] (do_vfs_ioctl+0x584/0x5d0)
[ 82.935119] [<c01b21d4>] (do_vfs_ioctl+0x584/0x5d0) from [<c01b2258>] (SyS_ioctl+0x38/0x60)
[ 82.943481] [<c01b2258>] (SyS_ioctl+0x38/0x60) from [<c01090c0>] (ret_fast_syscall+0x0/0x30)
[ 82.951904] Code: e1a05000 0a00001f ea000017 e5943014 (e7951003)
[ 82.974609] pgd = c1200000
[ 82.977355] [ffffffe0] *pgd=05ffd821, *pte=00000000, *ppte=00000000
[ 82.983642] Internal error: Oops: 17 [#2] PREEMPT ARM
[ 82.988677] Modules linked in: seh iml_module gs_modem cploaddev cidatattydev ccinetdev cci_datastub audiostub xt_multiport xt_id xt_TCPMSS xt_REDIRECT xt_LOG xt_CT msocketk ipt_MASQUERADE hwmap fastpath citty gpio_button_hotplug
[ 83.009033] CPU: 0 PID: 1367 Comm: hotplug-call Tainted: G D 3.10.33 #53
[ 83.016601] task: c11c6300 ti: c11fe000 task.ti: c11fe000
[ 83.022003] PC is at kmem_cache_alloc+0x88/0x108
[ 83.026641] LR is at squashfs_readdir+0x50/0x3ec
[ 83.031249] pc : [<c019dd30>] lr : [<c01f5674>] psr: a0000013
[ 83.031249] sp : c11ffe00 ip : c11ffe90 fp : c01f5674
[ 83.042724] r10: 00001d73 r9 : c11fe000 r8 : 000000d0
[ 83.047943] r7 : c11fe000 r6 : c11fe000 r5 : ffffffe0 r4 : c1801d00
[ 83.054473] r3 : 00000000 r2 : 00758aa3 r1 : 000000d0 r0 : c1801d00
[ 83.060974] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 83.068115] Control: 10c53c7d Table: 05200059 DAC: 00000015
[ 83.073852]
。。。。。。
[ 85.092773] [<c019f7e0>] (__kmalloc_track_caller+0xb8/0x140) from [<c042bfd4>] (__kmalloc_reserve.isra.46+0x24/0x6c)
[ 85.103332] [<c042bfd4>] (__kmalloc_reserve.isra.46+0x24/0x6c) from [<c042c084>] (__alloc_skb+0x68/0x134)
[ 85.112884] [<c042c084>] (__alloc_skb+0x68/0x134) from [<c0426f4c>] (sock_alloc_send_pskb+0xc8/0x32c)
[ 85.122131] [<c0426f4c>] (sock_alloc_send_pskb+0xc8/0x32c) from [<c04271cc>] (sock_alloc_send_skb+0x1c/0x24)
[ 85.131958] [<c04271cc>] (sock_alloc_send_skb+0x1c/0x24) from [<c048cc98>] (__ip_append_data.isra.44+0x3c8/0x8bc)
[ 85.142242] [<c048cc98>] (__ip_append_data.isra.44+0x3c8/0x8bc) from [<c048e544>] (ip_make_skb+0xa4/0xdc)
[ 85.151794] [<c048e544>] (ip_make_skb+0xa4/0xdc) from [<c04b0060>] (udp_sendmsg+0x4b0/0x7a0)
[ 85.160247] [<c04b0060>] (udp_sendmsg+0x4b0/0x7a0) from [<c04238d4>] (sock_sendmsg+0x78/0x8c)
[ 85.168792] [<c04238d4>] (sock_sendmsg+0x78/0x8c) from [<c0425bd4>] (SyS_sendto+0xb8/0xdc)
[ 85.177062] [<c0425bd4>] (SyS_sendto+0xb8/0xdc) from [<c0425c10>] (SyS_send+0x18/0x20)
[ 85.184967] [<c0425c10>] (SyS_send+0x18/0x20) from [<c01090c0>] (ret_fast_syscall+0x0/0x30)
[ 85.193328] Code: e1a05000 0a00001f ea000017 e5943014 (e7951003) |
|