码迷,mamicode.com
首页 > 其他好文 > 详细

nginx调试相关系统配置

时间:2014-07-01 10:40:32      阅读:1057      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   strong   width   

最近想尝试学习nginx,当然,准备一个nginx的debug环境是必不可少的。照着网上的文章编译好nginx debug版本,兴高采烈的准备通过gdb设置断点,进行debug时,无奈遇到一坨问题。在网上搜了些资料,自己摸索了半天,终于顺利搞定,记一笔,已留后用。

首先说明一下系统版本:RedHat Enterprise Linux 6.3 (rhel-6.3, 2.6.32-279.el6.x86_64)

 

遇到的问题

在启动gdb,设置断点对nginx进行调试时报出如下信息:

Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6.x86_64 nss-softokn-freebl-3.12.9-11.el6.x86_64 openssl-1.0.0-20.el6_2.5.x86_64 pcre-7.8-4.el6.x86_64 zlib-1.2.3-27.el6.x86_64

bubuko.com,布布扣

 

在网上搜了一大串, 最终明确,是需要安装glibc/glibc-common/nss-softokn/openssl/pcre/zlib的debuginfo rpm包,于是在网上搜索,寻找debuginfo rpm包。找到的下载地址:http://debuginfo.centos.org/6/x86_64/。比对了指定版本,下载了:

glibc-debuginfo-2.12-1.80.el6.x86_64.rpm

glibc-debuginfo-common-2.12-1.80.el6.x86_64.rpm

nss-softokn-debuginfo-3.12.9-11.el6.x86_64.rpm

openssl-debuginfo-1.0.0-20.el6_2.5.x86_64.rpm

pcre-debuginfo-7.8-4.el6.x86_64.rpm

zlib-debuginfo-1.2.3-27.el6.x86_64.rpm

通过rpm –ivh xxxx安装之,心想一切搞定,结果又出现奇怪的问题:

warning: the debug information found in "/usr/lib/debug//usr/lib64/libcrypto.so.1.0.0.debug" does not match "/usr/lib64/libcrypto.so.10" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/usr/lib64/libcrypto.so.1.0.0.debug" does not match "/usr/lib64/libcrypto.so.10" (CRC mismatch).

Missing separate debuginfo for /usr/lib64/libcrypto.so.10

Try: yum --disablerepo=‘*‘ --enablerepo=‘*-debug*‘ install /usr/lib/debug/.build-id/3d/b461dfc7dd4bfb0398b359e6b172bfeb3a853b.debug

 

warning: the debug information found in "/usr/lib/debug//lib64/libz.so.1.2.3.debug" does not match "/lib64/libz.so.1" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/lib64/libz.so.1.2.3.debug" does not match "/lib64/libz.so.1" (CRC mismatch).

Missing separate debuginfo for /lib64/libz.so.1
Try: yum --disablerepo=‘*‘ --enablerepo=‘*-debug*‘ install /usr/lib/debug/.build-id/20/9a7ebeab54483fed76e2a984b4aeae29c66d69.debug

warning: the debug information found in "/usr/lib/debug//lib64/libc-2.12.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/lib64/libc-2.12.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).

Missing separate debuginfo for /lib64/libc.so.6
Try: yum --disablerepo=‘*‘ --enablerepo=‘*-debug*‘ install /usr/lib/debug/.build-id/64/7ba5bbe0cb2dbdb1c7afbc9c4e74da5db5f29e.debug

warning: the debug information found in "/usr/lib/debug//lib64/libfreebl3.so.debug" does not match "/lib64/libfreebl3.so" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/lib64/libfreebl3.so.debug" does not match "/lib64/libfreebl3.so" (CRC mismatch).

Missing separate debuginfo for /lib64/libfreebl3.so
Try: yum --disablerepo=‘*‘ --enablerepo=‘*-debug*‘ install /usr/lib/debug/.build-id/4d/7a7266f3e891524fb3434b559343422b69af09.debug

 

bubuko.com,布布扣

从输出的结果看,我估计是安装的debuginfo的rpm包,与我之前从rhel-6.3系统盘中安装正式包有差异。毕竟我是从centOS的网站上下载的debuginfo rpm包,估计是原生redhat提供的rpm包不一致所致。既然这样,那我得找找可以从哪里下载redhat提供的原生debuginfo rpm包了。怎样才能得到?  接着看:

 

如何从RedHat的官方网站获取debuginfo rpm

系统为redhat 6.3,之前从http://debuginfo.centos.org/6/x86_64/下载响应的debuginfo rpm包。但是下载下来的包安装后, 运行gdb进行调试时, 仍然说CRC Mismatch.查了下RedHat的官方网站, 找了好久才搞清楚如何从redhat官方网站下载相应的rpm包:

1. 登录redhat官方网站

2. 进入rpm包的search页面:https://rhn.redhat.com/rhn/channels/software/Search.do

bubuko.com,布布扣

 

3. 输入你想要找的debuginfo rpm包的名字:glibc, 找到对应的包:

bubuko.com,布布扣

 

4. 然后选择你需要的包:glibc-debuginfo

bubuko.com,布布扣

 

5. 这里实际上会列出所有的版本, 从其中选出你要的版本:glibc-debuginfo-2.12-1.80.el6.x86_64.rpm

bubuko.com,布布扣

 

6. 这个时候点击进入glibc-debuginfo-2.12-1.80.el6.x86_64.rpm的详细页面:

bubuko.com,布布扣

 

7. 你可以选择直接点击右下角的Download Package, 偶尔你会发现无法下载, 显示找不到该package

8. 如果遇到网络问题, 下到一半断掉了, 则多尝试几次

9. 如果不是网络问题, 是网页显示找不到页面, 则尝试另外一种办法, 点解页面中的:“

RHEL Server Debuginfo (v.6 for x86_64) 进入整个RHEL Server Debuginfo(v.6)的页面

bubuko.com,布布扣

 

10. 通过点击第3个tab:Packages,从整个debuginfo包里,选择你需要的rpm包进行下载:

bubuko.com,布布扣

 

11. 这里, 你可以在“Filter by Package:"中输入你想要的rpm包,然后通过点击"Download Packages " 统一下载

bubuko.com,布布扣

 

 

bubuko.com,布布扣

 

12. 点击"Download Selected Packages Now!" ,系统将会打包"rhn-packages.tar",下载到本地(有可能下载中途断掉,则不断重新尝试,或者分成多个包,分别下载, 最终你要的Red Hat提供的debuginfo rpm包就全部获取成功了!, 通过各包的信息页面, 你可以比对你下载下来的rpm包的md5码, 确认数据没有问题

bubuko.com,布布扣

 

重新安装debuginfo rpm包

首先rpm -e卸载之前的安装包, 之后将从redhat官网下载的debuginfo rpm重新安装,再试试是否可以gdb调试nginx

bubuko.com,布布扣

一切OK啦~!

nginx调试相关系统配置,布布扣,bubuko.com

nginx调试相关系统配置

标签:style   blog   http   color   strong   width   

原文地址:http://www.cnblogs.com/lday/p/3817531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!