有关insmod的问题

76 views
Skip to first unread message

富满堂

unread,
Jun 21, 2010, 5:58:37 AM6/21/10
to linux-kernel
hi,大家好
我今天insmod一个模块产生如下错误,百思不得其解,请高手帮忙看看这些打印信息是什么意思。
谢谢。
[root@localhost home]# insmod g_***.ko
[ 27.092663] ------------[ cut here ]------------
[ 27.092691] kernel BUG at net/core/dev.c:4795!
[ 27.092700] invalid opcode: 0000 [#1] PREEMPT SMP
[ 27.092713] last sysfs file: /sys/devices/pci0000:00/uevent
[ 27.092721] Modules linked in: g_nokia(+)
[ 27.092735]
[ 27.092745] Pid: 657, comm: insmod Not tainted 2.6.33.2 #3 /
[ 27.092755] EIP: 0060:[<c0715c09>] EFLAGS: 00010206 CPU: 1
[ 27.092780] EIP is at rollback_registered_many+0x2b9/0x310
[ 27.092788] EAX: 00000003 EBX: da59d800 ECX: d92c6000 EDX: d92c7e74
[ 27.092796] ESI: d92c7e30 EDI: cf532ec0 EBP: d92c7e60 ESP: d92c7e3c
[ 27.092805] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 27.092815] Process insmod (pid: 657, ti=d92c6000 task=d9185490 task.ti=d92c6000)
[ 27.092823] Stack:
[ 27.092828] c0c5d6f4 c0c5d6e0 d9185490 d92c7e74 22222222 22222222 da59d800 00000000
[ 27.092851] <0> cf532ec0 d92c7e84 c0715d0f d92c7e7c c0878085 c0720d3f da59d844 da59d844
[ 27.092875] <0> da59d800 dc006e08 d92c7e90 c0715d74 cf532ee4 d92c7e98 e9d2f32d d92c7ee0
[ 27.092901] Call Trace:
[ 27.092916] [<c0715d0f>] ? unregister_netdevice_queue+0x5f/0xb0
[ 27.092929] [<c0878085>] ? mutex_lock_nested+0x35/0x40
[ 27.092941] [<c0720d3f>] ? rtnl_lock+0xf/0x20
[ 27.092951] [<c0715d74>] ? unregister_netdev+0x14/0x20
[ 27.092977] [<e9d2f32d>] ? nokia_unbind+0xd/0x21 [g_nokia]
[ 27.092995] [<e9d2f208>] ? composite_unbind+0xf8/0x210 [g_nokia]
[ 27.093007] [<c0720d18>] ? rtnl_unlock+0x8/0x10
[ 27.093024] [<e9d37634>] ? composite_bind+0x307/0x318 [g_nokia]
[ 27.093038] [<c0603ee4>] ? usb_gadget_register_driver+0x94/0x1a0
[ 27.093049] [<c0603ee9>] ? usb_gadget_register_driver+0x99/0x1a0
[ 27.093064] [<c015ff6d>] ? __blocking_notifier_call_chain+0x4d/0x60
[ 27.093081] [<e9d3769d>] ? nokia_init+0x0/0xf [g_nokia]
[ 27.093098] [<e9d3768e>] ? usb_composite_register+0x49/0x58 [g_nokia]
[ 27.093115] [<e9d376aa>] ? nokia_init+0xd/0xf [g_nokia]
[ 27.093127] [<c0101033>] ? do_one_initcall+0x23/0x170
[ 27.093138] [<c015ff9a>] ? blocking_notifier_call_chain+0x1a/0x20
[ 27.093151] [<c0179013>] ? sys_init_module+0xb3/0x220
[ 27.093164] [<c01d1270>] ? sys_close+0x70/0xc0
[ 27.093175] [<c0102d90>] ? sysenter_do_call+0x12/0x31
[ 27.093182] Code: c3 90 89 44 24 04 c7 04 24 3c 9d b8 c0 e8 5c 07 16 00 e9 3f ff ff ff ba dc 12 00 00 b8 67 42 b8 c0 e8 4c 6b a2
ff e9 6d ff ff ff <0f> 0b eb fe 8d 76 00 c7 44 24 08 e6 00 00 00 c7 44 24 04 67 42
[ 27.093334] EIP: [<c0715c09>] rollback_registered_many+0x2b9/0x310 SS:ESP 0068:d92c7e3c
[ 27.093363] ---[ end trace 407b3abc7f737788 ]---
Segmentation fault
_______________________________________________
Linux 内核开发中文邮件列表
Linux-...@zh-kernel.org
http://zh-kernel.org/mailman/listinfo/linux-kernel
Linux 内核开发中文社区: http://zh-kernel.org

helight

unread,
Jun 24, 2010, 9:32:53 PM6/24/10
to 富满堂, linux-kernel

这种错误一般是你的指针处理没有处理好!出现使用非法越界!
你可以跟踪调试一下,把这个语句先定位出来!
[root@localhost home]# insmod g_***.ko 你这个***是什么意思啊
g_nokia


> _______________________________________________
> Linux 内核开发中文邮件列表
> Linux-...@zh-kernel.org
> http://zh-kernel.org/mailman/listinfo/linux-kernel
> Linux 内核开发中文社区: http://zh-kernel.org


--
------------------
Zhenwen Xu - Open and Free
Home Page: http://zhwen.org
My Studio: http://dim4.cn

Américo Wang

unread,
Jun 24, 2010, 10:53:01 PM6/24/10
to 富满堂, linux-kernel
On Mon, Jun 21, 2010 at 05:58:37PM +0800, 富满堂 wrote:
>hi,大家好
> 我今天insmod一个模块产生如下错误,百思不得其解,请高手帮忙看看这些打印信息是什么意思。
> 谢谢。
> [root@localhost home]# insmod g_***.ko
>[ 27.092663] ------------[ cut here ]------------
>[ 27.092691] kernel BUG at net/core/dev.c:4795!


触发了一个BUG_ON(),在net/core/dev.c的第4795行。

最新的tree中不是对应这一行,但应该是附近的,所以应该是rollback_register_many()
中的BUG_ON(dev_boot_phase);,它的意思是你不应该在启动时调用这个函数。


但你这个call trace不是在boot阶段出现的,而只是一个普通的module_init。。。

从调用composite_unbind()来看应该是composite_bind()中某个地方出错。

zhangleo

unread,
Jun 24, 2010, 11:32:24 PM6/24/10
to jiuxi...@foxmail.com, linux-...@zh-kernel.org

[ 27.092691] kernel BUG at net/core/dev.c:4795!
[ 27.092700] invalid opcode: 0000 [#1] PREEMPT SMP
[ 27.092713] last sysfs file: /sys/devices/pci0000:00/uevent
[ 27.092721] Modules linked in: g_nokia(+)
看着像内核模块在调用函数指针时,指针为空
_________________________________________________________________
想知道明天天气如何?必应告诉你!
http://cn.bing.com/search?q=%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5&form=MICHJ2
Reply all
Reply to author
Forward
0 new messages