gdb调试时的问题Missing separate debuginfos, use: debuginfo-install glibc-XXX

在使用gdb调试CentOS6.4时遇到问题,当尝试使用`bt`命令时,系统显示缺少单独的debuginfo,提示需要安装glibc的特定版本。尝试按照提示通过`debuginfo-install`命令安装相应版本的glibc,但安装过程中遇到了问题。
部署运行你感兴趣的模型镜像

在CentOS6.4下使用gdb进行调试的时候,

使用bt(breaktrace)命令时,会弹出如下的提示:

头一天提示:

Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.i686

问题没解决,第二天提示:

Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6.i686

但是直接按提示使用 debuginfo-install glibc-2.12-1.132.el6.i686去安装的时候会报如下的信息:

Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Checking for new repos for mirrors
No debuginfo packages available to install

使用yum来进行安装:

 sudo yum --nogpgcheck --enablerepo=debug install glibc-debuginfo
却提示:Error Downloading Packages:
 glibc-debuginfo-common-2.12-1.132.el6.i686: failure: glibc-debuginfo-common-2.12-1.132.el6.i686.rpm from debug: [Errno 256] No more mirrors to try.
使用yum install glibc安装,发现只是安装了一些基本库,不包含 glibc-debuginfo
后来搜索发现需要先修改“/etc/yum.repos.d/CentOS-Debuginfo.repo”文件的enable=1
文件内容如下:
# CentOS-Debug.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#

# All debug packages from all the various CentOS-5 releases
# are merged into a single repo, split by BaseArch
#
# Note: packages in the debuginfo repo are currently not signed
#

[debug]
name=CentOS-6 - Debuginfo
baseurl=http://debuginfo.centos.org/6/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6
enabled=1
保存之后,使用debuginfo-install glibc-2.12-1.132.el6.i686安装,输出如下:
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * extras: mirrors.yun-idc.com
 * updates: mirrors.yun-idc.com
debug                                                                                                                                 | 2.5 kB     00:00     
Checking for new repos for mirrors
--> Running transaction check
---> Package glibc-debuginfo.i686 0:2.12-1.132.el6 will be installed
--> Processing Dependency: glibc-debuginfo-common = 2.12-1.132.el6 for package: glibc-debuginfo-2.12-1.132.el6.i686
---> Package nss-softokn-debuginfo.i686 0:3.12.9-11.el6 will be installed
---> Package yum-plugin-auto-update-debug-info.noarch 0:1.1.30-17.el6_5 will be installed
--> Running transaction check
---> Package glibc-debuginfo-common.i686 0:2.12-1.132.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                                Arch                        Version                               Repository                    Size
=============================================================================================================================================================
Installing:
 glibc-debuginfo                                        i686                        2.12-1.132.el6                        debug                         10 M
 nss-softokn-debuginfo                                  i686                        3.12.9-11.el6                         debug                        1.0 M
 yum-plugin-auto-update-debug-info                      noarch                      1.1.30-17.el6_5                       updates                       22 k
Installing for dependencies:
 glibc-debuginfo-common                                 i686                        2.12-1.132.el6                        debug                        7.5 M

Transaction Summary
=============================================================================================================================================================
Install       4 Package(s)

Total size: 19 M
Total download size: 8.6 M
Installed size: 93 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): glibc-debuginfo-common-2.12-1.132.el6.i686.rpm                                                                                 | 7.5 MB     12:03     
(2/3): nss-softokn-debuginfo-3.12.9-11.el6.i686.rpm                                                                                   | 1.0 MB     01:56     
(3/3): yum-plugin-auto-update-debug-info-1.1.30-17.el6_5.noarch.rpm                                                                   |  22 kB     00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         10 kB/s | 8.6 MB     14:10     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : glibc-debuginfo-common-2.12-1.132.el6.i686                                                                                                1/4 
  Installing : glibc-debuginfo-2.12-1.132.el6.i686                                                                                                       2/4 
  Installing : yum-plugin-auto-update-debug-info-1.1.30-17.el6_5.noarch                                                                                  3/4 
  Installing : nss-softokn-debuginfo-3.12.9-11.el6.i686                                                                                                  4/4 
  Verifying  : glibc-debuginfo-common-2.12-1.132.el6.i686                                                                                                1/4 
  Verifying  : nss-softokn-debuginfo-3.12.9-11.el6.i686                                                                                                  2/4 
  Verifying  : glibc-debuginfo-2.12-1.132.el6.i686                                                                                                       3/4 
  Verifying  : yum-plugin-auto-update-debug-info-1.1.30-17.el6_5.noarch                                                                                  4/4 

Installed:
  glibc-debuginfo.i686 0:2.12-1.132.el6      nss-softokn-debuginfo.i686 0:3.12.9-11.el6      yum-plugin-auto-update-debug-info.noarch 0:1.1.30-17.el6_5     

Dependency Installed:
  glibc-debuginfo-common.i686 0:2.12-1.132.el6                                                                                                               

Complete!
OK,问题解决。
第二次安装总结:
1、需要先修改“/etc/yum.repos.d/CentOS-Debuginfo.repo”文件的enable=1;
2、使用 sudo yum install glibc 安装;
3、使用debuginfo-install glibc-2.12-1.132.el6.i686安装。
测试,安装成功。

您可能感兴趣的与本文相关的镜像

AutoGPT

AutoGPT

AI应用

AutoGPT于2023年3月30日由游戏公司Significant Gravitas Ltd.的创始人Toran Bruce Richards发布,AutoGPT是一个AI agent(智能体),也是开源的应用程序,结合了GPT-4和GPT-3.5技术,给定自然语言的目标,它将尝试通过将其分解成子任务,并在自动循环中使用互联网和其他工具来实现这一目标

### 解决缺少debuginfo问题 在分析coredump,如果出现“Missing separate debuginfos”的提示,说明系统缺少调试信息文件。为了解决这一问题,需要安装特定版本的`glibc`、`libgcc`和`libstdc++`的调试信息包。以下是针对`glibc-2.17-326.el7_9.3.i686`、`libgcc-4.8.5-44.el7.i686`和`libstdc++-4.8.5-44.el7.i686`的解决方案。 #### 安装步骤 1. **启用Debuginfo仓库** 在Red Hat Enterprise Linux(RHEL)或CentOS系统中,调试信息包通常存储在`debuginfo`仓库中。需要首先启用该仓库: ```bash sudo yum install -y yum-utils sudo yum-config-manager --enable rhel-7-server-debuginfo-rpms ``` 2. **安装调试信息包** 使用`debuginfo-install`命令安装所需的调试信息包。以下命令适用于指定版本的`glibc`、`libgcc`和`libstdc++`: ```bash sudo debuginfo-install glibc-2.17-326.el7_9.3.i686 libgcc-4.8.5-44.el7.i686 libstdc++-4.8.5-44.el7.i686 ``` 如果上述命令无法找到特定版本的包,可能需要手动下载并安装对应的`.rpm`文件[^1]。 3. **验证安装** 安装完成后,可以通过以下命令验证调试信息是否正确加载: ```bash gdb /path/to/executable (gdb) info sharedlibrary ``` 如果调试信息已成功加载,输出中会显示类似以下内容: ``` Loaded symbols for /lib/libc.so.6 ``` 4. **处理依赖冲突** 如果在安装过程中遇到依赖冲突,可以尝试使用`--skip-broken`选项跳过冲突,或者手动解决依赖关系: ```bash sudo yum install --skip-broken glibc-debuginfo-2.17-326.el7_9.3.i686 libgcc-debuginfo-4.8.5-44.el7.i686 libstdc++-debuginfo-4.8.5-44.el7.i686 ``` #### 注意事项 - 确保系统已更新至最新状态,以避免因版本不匹配导致的问题: ```bash sudo yum update -y ``` - 如果目标系统是32位架构,需确保已启用相应的32位仓库支持: ```bash sudo yum-config-manager --enable rhel-7-server-optional-rpms ``` #### 示例代码 以下是一个简单的脚本,用于自动化安装调试信息包: ```bash #!/bin/bash # 启用debuginfo仓库 sudo yum install -y yum-utils sudo yum-config-manager --enable rhel-7-server-debuginfo-rpms # 安装调试信息包 PACKAGES="glibc-2.17-326.el7_9.3.i686 libgcc-4.8.5-44.el7.i686 libstdc++-4.8.5-44.el7.i686" for pkg in $PACKAGES; do sudo debuginfo-install $pkg done # 验证安装 gdb /path/to/executable ``` ### 总结 通过启用`debuginfo`仓库并使用`debuginfo-install`命令,可以有效解决“Missing separate debuginfos”的问题。确保安装的调试信息包与系统中运行的库版本一致,以避免潜在的兼容性问题[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值