我的内核在kmem_cache_alloc上使用了Oops编号5.我用Google搜索了表示的内容,发现它意味着“在用户模式下的读访问期间页面保护错误”。我无法找到页面保护错误。它与一般保护故障相同吗?
[ 402.554964] Unable to handle kernel NULL pointer dereference at virtual address 00000001
[ 402.562995] pgd = c84ac000
[ 402.566132] [00000001] *pgd=00000000
[ 402.573958] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 402.579209] Modules linked in: bcmdhd
[ 402.582923] CPU: 0 PID: 2507 Comm: MediaScannerSer Not tainted 3.10.10+ #1
[ 402.589703] task: c7eab480 ti: c23b0000 task.ti: c23b0000
[ 402.595036] PC is at kmem_cache_alloc+0x78/0x1c4
[ 402.599603] LR is at fat_parse_long+0x2e4/0x314
[ 402.604095] pc : [<c01031bc>] lr : [<c01f3f2c>] psr: 20000013
[ 402.604095] sp : c23b1bf8 ip : c23b1c38 fp : c23b1c34
[ 402.615400] r10: 007d9000 r9 : 00000000 r8 : c01f3f2c
[ 402.620579] r7 : 000000d0 r6 : ef001b80 r5 : c23b0000 r4 : 00000001
[ 402.637275] r3 : 00000000 r2 : c23b1c9c r1 : 000000d0 r0 : ef001b80
[ 402.643702] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 402.650719] Control: 10c5387d Table: 584ac06a DAC: 00000015
提前致谢。
答案 0 :(得分:4)
[ 402.554964] Unable to handle kernel NULL pointer dereference at virtual address 00000001
您的代码中某处可能有一个NULL
指针。你有这样的事情:
my_variable->my_sub_structure->my_field
其中my_sub_structure
为NULL
,因此代码会尝试从无效的内存地址到达my_field。