【问题标题】:Kernel oops -Page protection fault内核 oops - 页面保护错误
【发布时间】:2013-12-06 00:26:38
【问题描述】:

我的内核在 kmem_cache_alloc 处发生了错误,错误编号为 5。我用谷歌搜索了它的含义,发现它的意思是“在用户模式下读取访问期间出现页面保护错误”。我无法找到页面保护错误是什么。和一般保护故障一样吗?

[  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

提前致谢。

【问题讨论】:

    标签: linux kernel


    【解决方案1】:
    [  402.554964] Unable to handle kernel NULL pointer dereference at virtual address 00000001
    

    很可能,您的代码中某处有一个NULL 指针。你有这样的东西:

    my_variable->my_sub_structure->my_field
    

    其中my_sub_structureNULL,因此代码会尝试从无效的内存地址访问 my_field。

    【讨论】:

    • 谢谢。我发现哪个指针错误地变为 NULL。但是我仍然很想知道页面保护错误是什么。有人可以解释一下吗?
    • 您正在尝试访问不属于您的进程的内存页面地址 (00000001)
    猜你喜欢
    • 2014-11-10
    • 2020-12-29
    • 1970-01-01
    • 1970-01-01
    • 2013-06-05
    • 2014-05-21
    • 1970-01-01
    • 1970-01-01
    • 2012-10-29
    相关资源
    最近更新 更多