免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2344 | 回复: 2
打印 上一主题 下一主题

[文件系统] rmmod时出现Segmentation fault [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-07-09 11:51 |只看该作者 |倒序浏览
最近在海思平台上新编译了一把busybox,v1.23.0版本,但是使用的时候发现 rmmod 不正常,具体如下:

[root@dvrdvs printk] # rmmod printk_test
rmmod: can't change directory to '/lib/modules': No such file or directory

这时我创建了 /lib/modules ,然后就

[root@dvrdvs printk] # rmmod printk_test
rmmod: can't change directory to '3.0.8': No such file or directory

我有创建了 /lib/modules/3.0.8,下面又

root@dvrdvs lib] # rmmod printk_test
rmmod/18104: potentially unexpected fatal signal 11.


Pid: 18104, comm:                rmmod
CPU: 0    Tainted: P             (3.0.8 #1)
PC is at 0x2439c
LR is at 0x24300
pc : [<0002439c>]    lr : [<00024300>]    psr: 20000010
sp : be8779d8  ip : 401adcec  fp : 00000000
r10: 00000000  r9 : be877e18  r8 : 00000001
r7 : 00000000  r6 : be877ef7  r5 : 00000000  r4 : 000fac50
r3 : 003d7030  r2 : 00000000  r1 : 401ae0a8  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 89588059  DAC: 00000015
[<c0036b14>] (show_regs+0x0/0x50) from [<c00846d0>] (get_signal_to_deliver+0x374/0x37
r4:00106001 r3:60000113
[<c008435c>] (get_signal_to_deliver+0x0/0x37 from [<c0037940>] (do_signal+0x78/0x5b0)
[<c00378c8>] (do_signal+0x0/0x5b0) from [<c0037ec8>] (do_notify_resume+0x50/0x5c)
[<c0037e78>] (do_notify_resume+0x0/0x5c) from [<c0035018>] (work_pending+0x24/0x2
r4:ffffffff r3:00000000
Segmentation fault


这里我就崩溃了,用厂家自带的 1.16.1 的busybox就没问题,请问大神们可能是什么问题导致的?从上面看是非法访问了,猜想是文件系统的问题,但不知如何验证和解决。

论坛徽章:
0
2 [报告]
发表于 2015-07-09 11:52 |只看该作者
其他使用倒还没有发现异常

论坛徽章:
0
3 [报告]
发表于 2015-07-09 16:03 |只看该作者
问题找到了,是busybox配置问题。在
Location:                    
       -> Linux Module Utilities

如果配置了 Simplified modutils ,配置选项如下:
[*] Simplified modutils     
[*]   Accept module options on modprobe command line (NEW)
[*]   Skip loading of already loaded modules (NEW)   
--- Options common to multiple modutils      
[ ] Try to load module from a mmap'ed area     
(/lib/modules) Default directory containing modules   
(modules.dep) Default name of modules.dep

如果没有配置 Simplified modutils ,配置选项如下:
[*] modinfo      
[ ] Simplified modutils
[*]   insmod        
[*]   rmmod      
[*]   lsmod      
*]     Pretty output     
[*]   modprobe     
[*]     Blacklist support        
[*]   depmod                                 
--- Options common to multiple modutils         
[ ] Support version 2.2/2.4 Linux kernels                                 
[ ] Try to load module from a mmap'ed area                                   
[*] Support tainted module checking with new kernels                        
[*] Support for module.aliases file                             
[*] Support for module.symbols file                        
(/lib/modules) Default directory containing modules      
(modules.dep) Default name of modules.dep  

默认用的是上面那种配置,现在我不配置 Simplified modutils,选择 insmod 等,就可以正常 rmmod 了
有关Simplified modutils,busybox-1.23.0的说明如下:
CONFIG_MODPROBE_SMALL:                                                                                                                                                               │  
  │                                                                                                                                                                                      │  
  │ Simplified modutils.                                                                                                                                                                 │  
  │                                                                                                                                                                                      │  
  │ With this option modprobe does not require modules.dep file                                                                                                                          │  
  │ and does not use /etc/modules.conf file.                                                                                                                                             │  
  │ It scans module files in /lib/modules/`uname -r` and                                                                                                                                 │  
  │ determines dependencies and module alias names on the fly.                                                                                                                           │  
  │ This may make module loading slower, most notably                                                                                                                                    │  
  │ when one needs to load module by alias (this requires                                                                                                                                │  
  │ scanning through module _bodies_).                                                                                                                                                   │  
  │                                                                                                                                                                                      │  
  │ At the first attempt to load a module by alias modprobe                                                                                                                              │  
  │ will try to generate modules.dep.bb file in order to speed up                                                                                                                        │  
  │ future loads by alias. Failure to do so (read-only /lib/modules,                                                                                                                     │  
  │ etc) is not reported, and future modprobes will be slow too.                                                                                                                         │  
  │                                                                                                                                                                                      │  
  │ NB: modules.dep.bb file format is not compatible                                                                                                                                     │  
  │ with modules.dep file as created/used by standard module tools.                                                                                                                      │  
  │                                                                                                                                                                                      │  
  │ Additional module parameters can be stored in                                                                                                                                        │  
  │ /etc/modules/$module_name files.                                                                                                                                                     │  
  │                                                                                                                                                                                      │  
  │ Apart from modprobe, other utilities are also provided:                                                                                                                              │  
  │ - insmod is an alias to modprobe                                                                                                                                                     │  
  │ - rmmod is an alias to modprobe -r                                                                                                                                                   │  
  │ - depmod generates modules.dep.bb                                                                                                                                                    │  
  │                                                                                                                                                                                      │  
  │ As of 2008-07, this code is experimental. It is 14kb smaller                                                                                                                         │  
  │ than "non-small" modutils.  

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP