Linux問題情報分享(3):CentOS7上最新kernel-debuginfo包與當前核心版本不匹配
CentOS 7上最新的kernel-debuginfo包,是kernel-debuginfo-4.x.x-x.el7,而當前核心是kernel-3.10.0。因此,如果安裝或者升級到了最新的kernel-debuginfo包,會導致類似SystemTap這樣需要核心標頭檔案和除錯符號的工具執行出錯。這是CentOS 7的bug。
以SystemTap為例,其報錯大致如下
[root@pusf ~]# rpm -qa | grep kernel-debuginfo
kernel-debuginfo-4.9.31-203.el7.centos.x86_64
kernel-debuginfo-common-x86_64-4.9.31-203.el7.centos.x86_64[root@pusf ~]
[root@pusf ~]# stap -v -e `probe vfs.read {printf("read performed
"); exit()}`
Pass 1: parsed user script and 119 library scripts using 117224virt/33688res/3120shr/30824data kb, in 240usr/10sys/292real ms.
semantic error: while resolving probe point: identifier `kernel` at /usr/share/systemtap/tapset/linux/vfs.stp:882:18
source: probe vfs.read = kernel.function("vfs_read")
^
semantic error: missing x86_64 kernel/module debuginfo [man warning::debuginfo] under `/lib/modules/3.10.0-514.26.2.el7.x86_64/build`
semantic error: while resolving probe point: identifier `vfs` at <input>:1:7
source: probe vfs.read {printf("read performed
"); exit()}
^
semantic error: no match
Pass 2: analyzed script: 0 probes, 0 functions, 0 embeds, 0 globals using 120568virt/37092res/5108shr/32068data kb, in 100usr/140sys/443real ms.
Missing separate debuginfos, use: debuginfo-install kernel-3.10.0-514.26.2.el7.x86_64
Pass 2: analysis failed. [man error::pass2]
[root@pusf ~]#
因此,出現這種情況時,需要解除安裝kernel-debuginfo-4.x.x-x.el7和kernel-debuginfo-common-4.x.x-x.el7的包,重新按照當前核心版本安裝kernel-debuginfo即可
rpm -qa | grep -E `^kernel-` | grep -v 3.10.0 | xargs yum -y remove
debuginfo-install -y kernel-$(uname -r)
再測試下SystemTap的指令碼,會發現問題已經解決了
[root@pusf ~]# rpm -qa | grep kernel-debuginfo
kernel-debuginfo-common-x86_64-3.10.0-514.26.2.el7.x86_64
kernel-debuginfo-3.10.0-514.26.2.el7.x86_64
[root@pusf ~]# stap -v -e `probe vfs.read {printf("read performed
"); exit()}`
Pass 1: parsed user script and 119 library scripts using 117224virt/33684res/3120shr/30824data kb, in 230usr/10sys/293real ms.
Pass 2: analyzed script: 1 probe, 1 function, 4 embeds, 0 globals using 248216virt/165932res/4336shr/161816data kb, in 1260usr/370sys/1809real ms.
Pass 3: translated to C into "/tmp/stapI5iwL4/stap_1aa47f863c3f13e51da3e80cc92942be_1682_src.c" using 248216virt/166236res/4640shr/161816data kb, in 20usr/40sys/57real ms.
Pass 4: compiled C into "stap_1aa47f863c3f13e51da3e80cc92942be_1682.ko" in 5550usr/1240sys/7187real ms.
Pass 5: starting run.
read performed
Pass 5: run completed in 0usr/60sys/378real ms.
[root@pusf ~]#
在CentOS官方修正bug前,可以在/etc/yum.conf中加入如下配置,先排除問題包
exclude=kernel-debuginfo*
這樣,升級時不會再次安裝了問題包。當然,核心升級時,需要額外調整下配置。
順便說下,在Ubuntu上使用SystemTap,需要額外配置和步驟,請參考SystemTap on Ubuntu。
參考
相關文章
- Scala版本與Java版本不匹配導致的找不到主類問題Java
- 安裝rabbitmq遇到各種問題,多數是erlang與rabbitmq版本不匹配MQ
- 檢視當前linux的核心版本(轉)Linux
- 解決 requests-2.17.3 依賴 chardet 庫版本不匹配的問題
- 六步升級你的Debian Linux核心到當前最新穩定版本(轉)Linux
- spring boot 2.0.0由於版本不匹配導致的NoSuchMethodError問題解析Spring BootError
- Django2.2使用mysql資料庫pymysql版本不匹配問題的解決過程與總結DjangoMySql資料庫
- 搭建Laravel Sail開發環境遇到的版本不匹配問題解決方法LaravelAI開發環境
- Linux當前當前程式Linux
- 當前主流、最新技術回眸(三)
- LeetCode 3: PairsOfParentheses (括號匹配問題)LeetCodeAI
- 字串匹配問題字串匹配
- node與python版本不匹配報錯:node-gyp rebuildPythonRebuild
- 當流量尖峰到達時,在 Linux 核心中解決網路問題Linux
- 關於 Linux 核心的10個面試問題與答案Linux面試
- Linux核心設計與實現(原書第3版)筆記Linux筆記
- minikube與kubectl版本不一致問題
- Java - java與javac版本不一致問題Java
- 輸出當前分支的最新commit IDMIT
- 戴文的Linux核心專題:07 配置核心 (3)Linux
- JAVA最新面試題分享Java面試題
- 解決Windows下SVN上UUID不匹配問題WindowsUI
- js關閉當前頁面視窗的問題JS
- CentOS7 編譯安裝最新的Linux Kernel 6.0 rc3CentOS編譯Linux
- Django在Linux上uwsgi 與nginx的問題與解決DjangoLinuxNginx
- 字串匹配模式問題字串匹配模式
- 經典問題 2 —— 動態不包含區間與點完美匹配問題
- 當前主流瀏覽器核心有哪幾個瀏覽器
- 《噬神者3》最新情報:全新荒神角色系統放出!
- Netty拾遺(七)——粘包與拆包問題Netty
- 當前NLP遷移學習中的一些問題遷移學習
- RN+SDK套殼輕鬆解決蘋果稽核被拒3.2.1問題、2.1大禮包問題【最新上架技術】蘋果
- CentOS7通過持續整合包安裝最新的MonoCentOSMono
- 神奇解決NoClassDefFoundError版本不同的問題Error
- centos7 下解決mysql-server找不到安裝包問題CentOSMySqlServer
- 剛剛下載一個最新的包,安裝有問題
- DP 6.1版本在linux Client上的問題解決方法Linuxclient
- urlrewrite偽靜態匹配問題