TI中文支持网
TI专业的中文技术问题搜集分享网站

AM335x 添加4G模块 使用usb串口 内存泄漏

我使用的是am335x 的 Linux 4.14 内核,在移植移远4g模块EC20时出现了如下问题:

我能够在设备中发现ttyUSB0~3,并且可以使用ppp拨号成功拨号,但是在拨号成功一小段时间后系统就会发生内存泄漏之后死机,我搜索后发现是在内核driver/usb/core/urb.c文件中的usb_anchor_urb函数中的list_add_tail函数发生的问题,我不知道发生了什么,是系统的bug吗,我是安装模块安装说明书进行的配置,之前在4.1.18内核中可以正常加载4g模块,并不会发生这个问题,希望有人可以解答一下,附问题如下:

[ 99.259592] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 99.268187] pgd = db0d8000
[ 99.271068] [00000000] *pgd=00000000
[ 99.274892] Internal error: Oops: 805 [#1] PREEMPT ARM
[ 99.280356] Modules linked in:
[ 99.283632] CPU: 0 PID: 97 Comm: sd-resolve Tainted: G W 4.14.79-ge669d52447 #37
[ 99.292686] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 99.299163] task: dc59de00 task.stack: db0c8000
[ 99.304012] PC is at usb_anchor_urb+0x9c/0x128
[ 99.308767] LR is at wake_up_klogd+0x5c/0x90
[ 99.313308] pc : [<c05fb148>] lr : [<c0168eec>] psr: 200e0093
[ 99.319966] sp : db0c9858 ip : 00000007 fp : db0c987c
[ 99.325519] r10: 00000043 r9 : c0d16680 r8 : db0c8000
[ 99.331074] r7 : 200e0093 r6 : dc5d8d9c r5 : dc554404 r4 : dc5d8d80
[ 99.338011] r3 : 00000000 r2 : 00000a05 r1 : 00000000 r0 : c0b0d47c
[ 99.344953] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
[ 99.352629] Control: 10c5387d Table: 9b0d8019 DAC: 00000051
[ 99.358735] Process sd-resolve (pid: 97, stack limit = 0xdb0c8210)
[ 99.365303] Stack: (0xdb0c9858 to 0xdb0ca000)
[ 99.369941] 9840: 00000000 db0c9868
[ 99.378644] 9860: 00000000 dc5543e0 dc5d8d80 00000043 db0c98d4 db0c9880 c0621814 c05fb0b8
[ 99.387343] 9880: db0c989c db0c9890 00000043 dc5543c0 a00e0013 01080020 dc5f4000 dc5df180
[ 99.396042] 98a0: db3e80b0 dc554400 00000040 c0621678 db1dd60e 00000040 00000001 c0924ff8
[ 99.404745] 98c0: db3e8000 00000001 db0c98ec db0c98d8 c061b654 c0621684 00000043 db1dd60e…

yongqing wang:

对比一下两个内核整个USB的目录下的文件看看

ping gong:

回复 yongqing wang:

我对比过了,是相同的,我使用gdb查看错误报告发现错误定位在/include/linux/compiler.h文件,具体如下:

root@gong:/opt/ti-am335x-20190514/board-support/linux# arm-linux-gnueabihf-gdb vmlinux

GNU gdb (GDB) 8.0

Copyright (C) 2017 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.

This GDB was configured as "–host=x86_64-arago-linux –target=arm-linux-gnueabi".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.

Find the GDB manual and other documentation resources online at:

<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".

Type "apropos word" to search for commands related to "word"…

Reading symbols from vmlinux…done.

(gdb) l *(usb_anchor_urb+0x9c)

0xc05fb148 is in usb_anchor_urb (./include/linux/compiler.h:211).

206 static __always_inline void __write_once_size(volatile void *p, void *res, int size)

207 {

208 switch (size) {

209 case 1: *(volatile __u8 *)p = *(__u8 *)res; break;

210 case 2: *(volatile __u16 *)p = *(__u16 *)res; break;211 case 4: *(volatile __u32 *)p = *(__u32 *)res; break;

212 case 8: *(volatile __u64 *)p = *(__u64 *)res; break;

213 default:

214 barrier();

215 __builtin_memcpy((void *)p, (const void *)res, size);

(gdb)

赞(0)
未经允许不得转载:TI中文支持网 » AM335x 添加4G模块 使用usb串口 内存泄漏
分享到: 更多 (0)