Unable to handle kernel paging request at virtual address错误的解决

今天写了一个触摸屏的驱动程序,在卸载模块时出现oops,主要信息如下

 Unable to handle kernel paging request at virtual address cc33cc33

……

pc is at kfree+0x44/0xd4

……

经过分析,是因为对内存越界访问

//以下代码导致oops,原因是越界访问
ts_dev.buf[wr_pt].x=xdata;
ts_dev.buf[wr_pt].y=ydata;
if(wr_pt!=(MAX_TS_BUF-1))//注意要减1,否则发生错误
{
wr_pt++;
}
else
{
wr_pt=0;
}
//*************************

原因就是编写代码的时候忘记-1,导致对数组越界访问,非常低级的错误。

在编写驱动程序时,出现oops错误大部分原因是由于对非法内存的访问,因此在编写代码时要十分注意所访问的内存是否合法。否则将浪费很多时间在调试上。



展开阅读全文

请教 Unable to handle kernel paging request at virtual address 60519ad0 问题

09-22

在开发板上运行程序, 程序运行一段时间之后(这个时间不好确定,有时候是几分钟有时候是几个小时)程序就会退出不再执行,通过串口的打印可以看到如下的信息:rnrnUnable to handle kernel paging request at virtual address 60519ad0rnrnpgd = c1e60000rnrn[60519ad0] *pgd=00000000rnrnInternal error: Oops: 5 [#1]rnrnModules linked in: hi3510_vs pcf8563 hi_sio tlv320 adv7171 hi_i2c ohci_hcd misc_gpio hi_gpio hi3510_wdtrnrnCPU: 0rnrnPC is at 0xc0510720rnrnLR is at 0x10rnrnpc : [] lr : [<00000010>] Not taintedrnrnsp : c100de64 ip : 00000000 fp : c100df24rnrnr10: 00000000 r9 : c16501f8 r8 : 00000003rnrnr7 : 00000048 r6 : bf000000 r5 : c100de70 r4 : 00000000rnrnr3 : 60519ad0 r2 : 00000010 r1 : c100de70 r0 : bddffbb8rnrnFlags: nzCv IRQs on FIQs on Mode SVC_32 Segment userrnrnControl: 5317F Table: 61E60000 DAC: 00000015rnrnProcess dec_server (pid: 265, stack limit = 0xc100c194)rnrnStack: (0xc100de64 to 0xc100e000)rnrnde60: bddffbb8 c100de7c c0505790 bf027428 c100de7c c1e0f6cc 00000000 rnrnde80: 00000001 00000000 00000005 00000160 00000120 00000000 00000000 626c6100 rnrndea0: 62732100 00000000 00000300 00000300 00000000 00000001 bddffc00 00000000 rnrndec0: 00000001 c1e8ad00 c100df14 c100ded8 c01f5c70 c0037238 c1ee89b4 00000f30 rnrndee0: c1ee8abc 98c88520 0000111a 001cb213 00000002 c100c000 c100df18 c1e0f6cc rnrndf00: ffffffe7 c0484806 bddffbb8 00000000 c100c000 000c9104 c100df38 c100df28 rnrndf20: bf027820 bf01e914 bf027418 c100df58 c100df3c c00922f0 bf027814 c1e0f6cc rnrndf40: c16501f8 bddffbb8 00000011 c100df84 c100df5c c00925f4 c0092284 c007e544 rnrndf60: c0037238 c1e0f6cc fffffff7 c0484806 00000036 c0021f64 c100dfa4 c100df88 rnrndf80: c0092654 c0092314 00000001 000e3094 bddffd28 00000000 00000000 c100dfa8 rnrndfa0: c0021de0 c0092624 000e3094 c01f5610 00000011 c0484806 bddffbb8 00000001 rnrndfc0: 000e3094 bddffd28 00000000 000002a0 bddffc00 0016ad3c 000c9104 00000000 rnrndfe0: 00000011 bddffba0 0009c8e8 0009c8b0 a0000010 00000011 0606e306 e30606e3 rnrnBacktrace: rnrn[] (CMPI_UserCopy+0x0/0x19c [hi3510_vs]) from [] (DRV_VDEC_Ioctl+0x1c/0x24 [hi3510_vs])rnrn[] (DRV_VDEC_Ioctl+0x0/0x24 [hi3510_vs]) from [] (do_ioctl+0x7c/0x90)rnrn[] (do_ioctl+0x0/0x90) from [] (vfs_ioctl+0x2f0/0x310)rnrn r7 = 00000011 r6 = BDDFFBB8 r5 = C16501F8 r4 = C1E0F6CCrnrn[] (vfs_ioctl+0x0/0x310) from [] (sys_ioctl+0x40/0x60)rnrn r8 = C0021F64 r7 = 00000036 r6 = C0484806 r5 = FFFFFFF7rnrn r4 = C1E0F6CC rnrn[] (sys_ioctl+0x0/0x60) from [] (ret_fast_syscall+0x0/0x2c)rnrn r6 = 00000000 r5 = BDDFFD28 r4 = 000E3094 rnrnCode: e024249e e2800001 e5d0c000 e59f3044 (e7d3300c) rnrn rnrnrnrnrn研究了半天始终没搞明白为什么会出这种问题。不知道是程序的问题还是底层驱动的问题。rn请各位帮小弟看看这应该是哪个地方的问题。 论坛

Unable to handle kernel paging request at virtual address e5963064

03-13

Unable to handle kernel paging request at virtual address e5963064rnpgd = cf14c000rn[e5963064] *pgd=00000000rnInternal error: Oops: 5 [#1]rnModules linked in: gpmc_fpga(O)rnCPU: 0 Tainted: G O (3.2.0 #22)rnPC is at enqueue_task_fair+0xf8/0x18crnLR is at enqueue_task_fair+0x180/0x18crnpc : [] lr : [] psr: 20000193rnsp : cf061900 ip : e5963064 fp : cf061924rnr10: c0652acc r9 : 00000100 r8 : 00000001rnr7 : c05fa770 r6 : c05fa770 r5 : cf8a5170 r4 : cf8a5140rnr3 : cf276e70 r2 : c101e29f r1 : 00000000 r0 : cf8a5170rnFlags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment userrnControl: 10c5387d Table: 8f14c019 DAC: 00000015rnProcess fpga_app (pid: 1832, stack limit = 0xcf0602f0)rnStack: (0xcf061900 to 0xcf062000)rn1900: c0038c90 c05fa770 cf8a5140 00000001 cf060000 00200200 cf061944 cf061928rn1920: c0038230 c0038c9c 00000001 cf8a5140 a0000193 00000000 cf061954 cf061948rn1940: c00383f4 c0038200 cf061974 cf061958 c0038460 c00383c8 cf8ec980 cf9af78crn1960: c05fc1b0 c05fc1b0 cf061984 cf061978 c00384e4 c0038404 cf061994 cf061988rn1980: c004f594 c00384d8 cf0619b4 cf061998 c004f618 c004f578 00000000 60000113rn19a0: cf808ac0 c05fbc48 cf0619e4 cf0619b8 c004f824 c004f5a4 35cdbd01 000006e3rn19c0: 35cdbd01 cf061a08 c06522c0 c05fbc48 cf060000 00200200 cf0619f4 cf0619e8rn19e0: c004fa30 c004f770 cf061a3c cf0619f8 c0047858 c004fa14 00000000 00000000rn1a00: c004fa08 c06542b8 cf061a08 cf061a08 c06542bc 00000001 c0652148 cf060000rnBacktrace: rn[] (enqueue_task_fair+0x0/0x18c) from [] (enqueue_task.clone.126+0x3c/0x40)rnr8:00200200 r7:cf060000 r6:00000001 r5:cf8a5140 r4:c05fa770rnr3:c0038c90rn[] (enqueue_task.clone.126+0x0/0x40) from [] (activate_task.clone.128+0x38/0x3c)rnr6:00000000 r5:a0000193 r4:cf8a5140 r3:00000001rn[] (activate_task.clone.128+0x0/0x3c) from [] (try_to_wake_up+0x68/0xbc)rn[] (try_to_wake_up+0x0/0xbc) from [] (wake_up_process+0x18/0x1c)rnr6:c05fc1b0 r5:c05fc1b0 r4:cf9af78c r3:cf8ec980rn[] (wake_up_process+0x0/0x1c) from [] (wake_up_worker+0x28/0x2c)rn[] (wake_up_worker+0x0/0x2c) from [] (insert_work+0x80/0x84)rn[] (insert_work+0x0/0x84) from [] (__queue_work+0xc0/0x2a4)rnr6:c05fbc48 r5:cf808ac0 r4:60000113 r3:00000000rn[] (__queue_work+0x0/0x2a4) from [] (delayed_work_timer_fn+0x28/0x2c)rnr8:00200200 r7:cf060000 r6:c05fbc48 r5:c06522c0 r4:cf061a08rn[] (delayed_work_timer_fn+0x0/0x2c) from [] (run_timer_softirq+0xf8/0x208)rn[] (run_timer_softirq+0x0/0x208) from [] (__do_softirq+0xac/0x134)rn[] (__do_softirq+0x0/0x134) from [] (irq_exit+0x8c/0xa4)rn[] (irq_exit+0x0/0xa4) from [] (handle_IRQ+0x44/0x8c)rnr4:c0615904 r3:c0072f84rn[] (handle_IRQ+0x0/0x8c) from [] (omap3_intc_handle_irq+0x84/0x88)rnr6:00000044 r5:fa200000 r4:00000004 r3:00000002rn[] (omap3_intc_handle_irq+0x0/0x88) from [] (__irq_svc+0x40/0x60)rnException stack(0xcf061ae0 to 0xcf061b28)rn1ae0: 40441c94 cfa7cc1c 000005c0 1dfa1df9 001f001f 001e001e 001e001e 001f001ern1b00: 000005c0 404418a0 cfa7c82c cf061b94 000001d0 cf061b28 c0373bbc c01c9204rn1b20: 00000013 ffffffffrnr7:cf061b14 r6:ffffffff r5:00000013 r4:c01c9204rn[] (csum_partial_copy_fromiovecend+0x0/0x2d8) from [] (ip_generic_getfrag+0x44/0xb0)rn[] (ip_generic_getfrag+0x0/0xb0) from [] (__ip_append_data.clone.64+0x770/0x908)rnr4:cfada680rn[] (__ip_append_data.clone.64+0x0/0x908) from [] (ip_make_skb+0x98/0xcc)rn[] (ip_make_skb+0x0/0xcc) from [] (udp_sendmsg+0x2c0/0x82c)rn[] (udp_sendmsg+0x0/0x82c) from [] (inet_sendmsg+0x44/0x80)rn[] (inet_sendmsg+0x0/0x80) from [] (sock_sendmsg+0x9c/0xbc)rnr4:000010a0rn[] (sock_sendmsg+0x0/0xbc) from [] (sys_sendto+0xb8/0xdc)rnr9:cf060000 r8:00000000 r7:beb44b34 r6:cf47ee00 r5:404418a0rnr4:000010a0rn[] (sys_sendto+0x0/0xdc) from [] (ret_fast_syscall+0x0/0x30)rnCode: e2d31000 e1a0100e b28ec008 a3a08000 (e59ce000) rn---[ end trace 131c5971b74ee0a1 ]---rnKernel panic - not syncing: Fatal exception in interruptrnBacktrace: rn[] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c)rnr6:00000000 r5:cf060000 r4:c06417c8 r3:c05fad08rn[] (dump_stack+0x0/0x1c) from [] (panic+0x6c/0x1a0)rn[] (panic+0x0/0x1a0) from [] (die+0x140/0x2d8)rnr3:00000100 r2:00000000 r1:00000000 r0:c04feca0rnr7:cf06176arn[] (die+0x0/0x2d8) from [] (__do_kernel_fault+0x7c/0x8c)rn[] (__do_kernel_fault+0x0/0x8c) from [] (do_bad_area+0x44/0x6c)rnr8:cf0618b8 r7:cf14c000 r6:00000000 r5:c0004000 r4:20000193rnr3:cf0618b8rn[] (do_bad_area+0x0/0x6c) from [] (do_translation_fault+0x74/0xa8)rnr4:00000005rn[] (do_translation_fault+0x0/0xa8) from [] (do_DataAbort+0x3c/0xa0)rnr7:00000005 r6:c05e06bc r5:e5963064 r4:00000005rn[] (do_DataAbort+0x0/0xa0) from [] (__dabt_svc+0x38/0x60)rnException stack(0xcf0618b8 to 0xcf061900)rn18a0: cf8a5170 00000000rn18c0: c101e29f cf276e70 cf8a5140 cf8a5170 c05fa770 c05fa770 00000001 00000100rn18e0: c0652acc cf061924 e5963064 cf061900 c0038e10 c0038d88 20000193 ffffffffrnr8:00000001 r7:cf0618ec r6:ffffffff r5:20000193 r4:c0038d88rn[] (enqueue_task_fair+0x0/0x18c) from [] (enqueue_task.clone.126+0x3c/0x40)rn写了一个驱动,去读写fpga,通过mmap进行映射,然后应用程序使用udp进行发送。但每隔一段时间(几分钟或者几个小时),就会给出这些异常信息。我也不知道问题出在哪。 论坛

unable to handle kernel paging request at f80c6131

07-01

在Fedora 17上加载文件过滤驱动,第一次insmod可以执行,指定的文件也加密了,rmmod卸载也没问题,当第二次insmod内核就奔溃了出现黑屏,屏幕上信息如下:rnstarting virtualization daemon...rn[ok]Started virtualization daemon.rn Starting RPC bind service...rn[ok]Started Bluetooth Manager.rn[ok]Started RPC bind service.rn Starting NFS file locking service...rn[ok]Started OpenSSH server daemon.rn[ok]Started NFS file locking service..rn[ok]Started Sendmail Mail Transport Agent.rn Starting Sendmail Mail Transport Client...rn[ok]Started Sendmail Mail Transport Client.rn[227.299774]BUG:unable to handle kernel paging request at f80c6131rn[227.299875]*pdpt=0000000000d08001 *pde=00000000372a0067 *pte=0000000000000000rn[227.299941]0ops:0010 [#1] SMPrn[227.299973]Modules linked in:encryption(0) fuse be2iscsi iscsi_boot_sysfs bnx2i cnic ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM iptable_mangle bridge stp llc lockd sunrpc bnep bluetooth uio cxgb4i cxgb3i cxgb3 ip6t_REJECT mdio nf_conntrack_ipv6 libcxgbi nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 ib_iser rdma_cm ib_addr iw_cm xt_state nf_conntrack ip6table_filter ip6_tables ib_cn ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi mei vhost_net tun macvtap macvlan snd_hda_codec_realtek snd_hda_intel snd_hda_codec coretemp snd_hwdep iTCO_wdt iTCO_vendor_support snd_seq snd_seq_device snd_pcm ppdev kvm r8169 snd_page_alloc eeepc_wmi parport_pc asus_wmi sparse_keymap rfkill mii lpc_ich i2c_i801 mfd_core smd_timer parport snd soundcore microcode uinput crc32c_intel wmi i915 video i2c_algo_bit drm_kms_helper drm i2c_core [last unloaded:encryption]rn[227.300764]pid:590,comm:rsyslogd Tainted:G 0 3.8.13-100.fc17.i686.PAE #1 System manufacturer System Product Name/P9H61-M LX PLUSrn[227.300854]EIP:0060:[]EFLAGS:00010246 CPU:1rn[227.300898]EIP is at 0xf80c6131rn[227.300924]EAX:0000002c EBX:00000fff ECX:f1f9b2c0 EDX:00000000rn[227.300970]ESI:00000004 EDI:f6138a80 EBP:ef017fac ESP:ef017f90rn[227.301016] DS:007b ES:007b FS:00d8 GS:00e0 SS:0068rn[227.301055]CR0:80050033 CR2:f80c6131 CR3:2f6f9000 CR4:000407f0rn[227.301101]DR0:00000000 DR1:00000000 DR2:00000000 DR3:00000000rn[227.301146]DR6:ffff0ff0 DR7:00000400 rn[227.301176]Process rsyslogd (pid:590, ti=ef016000 tack=f1f9b2c0) tack.ti=ef016000)rn[227.301231]Stack:rn[227.301247] 00000004 b7723240 00000fff ef017fb0 00000004 b7723240 b64a22e0 ef016000rn[227.301323] c099f34d 00000004 b7723240 00000fff b7723240 b54a22e0 b64a2468 00000003rn[227.301398] 0000007b 0000007b 00000000 00000033 00000003 b772f424 00000073 00000293rn[227.301472]Call Tracern[227.301498][] sysenter_do_call+0x12/0x28rn[227.301535]Code: Bad EIP valuern[227.301567]EIP:[]0xf80c6131 SS:ESP 0068:ef017f90rn[227.301618]CRZ:00000000f80c6131rnrn死都想不通问题在哪rn各位大神,江湖救急额,急急急··· 论坛

没有更多推荐了,返回首页