2014-11-24 6 views
-3

라이브 env에서 세그먼트 화 오류가 발생했습니다. 코드 덤프 파일 인 을 gdb로 보내려고 시도했지만 코드 줄을 찾을 수 없습니다.__correctly_grouped_prefixwc에서 코어 덤프

Program terminated with signal 11, Segmentation fault. 
#0 0x00000038f3a41bf5 in __correctly_grouped_prefixwc() from /lib64/libc.so.6 
(gdb) bt 
#0 0x00000038f3a41bf5 in __correctly_grouped_prefixwc() from /lib64/libc.so.6 
#1 0x0000000000000000 in ??() 
(gdb) info r 
rax   0x1ac1b108  448901384 
rbx   0x2add423b4ff0 47129787322352 
rcx   0x2add48128640 47129885312576 
rdx   0x0  0 
rsi   0x1  1 
rdi   0x2add48000020 47129884098592 
rbp   0x2add3f1aef50 0x2add3f1aef50 
rsp   0x2add423b4ff0 0x2add423b4ff0 
r8    0x2  2 
r9    0x2  2 
r10   0x0  0 
r11   0x0  0 
r12   0x0  0 
r13   0x3  3 
r14   0x1000 4096 
r15   0x2add3f1b0000 47129734873088 
rip   0x38f3a41bf5  0x38f3a41bf5 <__correctly_grouped_prefixwc+165> 
eflags   0x10246 [ PF ZF IF RF ] 
cs    0x33  51 
ss    0x2b  43 
ds    0x0  0 
es    0x0  0 
fs    0x0  0 
gs    0x0  0 
fctrl   0x37f 895 
fstat   0x0  0 
ftag   0xffff 65535 
fiseg   0x0  0 
fioff   0xc54f06 12930822 
foseg   0x2add 10973 
fooff   0x423b3f00  1111179008 
fop   0x0  0 
mxcsr   0x1fa1 [ IE PE IM DM ZM OM UM PM ] 


cat /etc/redhat-release 
CentOS release 5.5 (Final) 

이와 나는 따라서 debuginfo 설치 프로그램을 설치 yum install yum-utils를 실행 소스 수준의 디버깅의 glibc로합니다. 다음, sudo debuginfo-install glibc 실행, 결과는

Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* addons: centos.ustc.edu.cn 
* base: mirror.bit.edu.cn 
* extras: centos.ustc.edu.cn 
* updates: centos.ustc.edu.cn 
Checking for new repos for mirrors 
Could not find debuginfo for main pkg: glibc-2.5-123.x86_64 
Could not find debuginfo for main pkg: glibc-2.5-123.i686 
No debuginfo packages available to install 

다음 다음 다시 발견 yum search glibc-debuginfo

Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* addons: centos.ustc.edu.cn 
* base: mirrors.163.com 
* extras: centos.ustc.edu.cn 
* updates: centos.ustc.edu.cn 
Warning: No matches found for: glibc-debuginfo 
No Matches found 

더 일치를 실행하지하려고합니다.

은 내가, 을 sudo yum install glibc-devel.x86_64를 실행하고 다시 코어 덤프 파일을 gdb를하려고 yum search glibc

Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* addons: centos.ustc.edu.cn 
* base: mirrors.163.com 
* extras: centos.ustc.edu.cn 
* updates: centos.ustc.edu.cn 
================================================================================ Matched: glibc ================================================================================= 
compat-glibc.i386 : Compatibility C library 
compat-glibc.x86_64 : Compatibility C library 
compat-glibc-headers.x86_64 : Header files for development using standard C libraries. 
glibc.i686 : The GNU libc libraries. 
glibc.x86_64 : The GNU libc libraries. 
glibc-common.x86_64 : Common binaries and locale data for glibc 
glibc-devel.i386 : Object files for development using standard C libraries. 
glibc-devel.x86_64 : Object files for development using standard C libraries. 
glibc-headers.x86_64 : Header files for development using standard C libraries. 
glibc-utils.x86_64 : Development utilities from GNU C library 
kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc 
nss_db.i386 : An NSS library for the Berkeley DB. 
nss_db.x86_64 : An NSS library for the Berkeley DB. 
yp-tools.x86_64 : NIS (or YP) client programs. 
yum-protect-packages.noarch : Yum plugin to prevents Yum from removing itself and other protected packages 

를 실행하려고하지만 내가 코드 라인 원인을 찾을 수있는 방법을 다음

Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. 
Loaded symbols for /lib64/libc.so.6 

를 표시 코어 덤프? 나는 Google에, 그러나 어떤 아이디어도, 찾아 내지 않는가?

+0

우리의 정확한 질문은 무엇입니까? – tristan

+0

_ "어떤 아이디어?"_ - 디버거를 사용하십시오. –

+0

어떻게 코드 라인 원인 코레 땅 펌프를 찾을 수 있습니까? – Sleepwom

답변

1

처음에는 __correctly_grouped_prefixwc이 세그먼트 오류를 ​​일으켰지 만 다른 코드 (아마도 strtod 또는 strtol)에서 잘못된 인수가 전달되었을 가능성이 있습니다. 즉, gdb이 세그먼트 화 오류를 일으킨 __correctly_grouped_prefixwc에 소스 코드 줄을 표시 할 수 있도록 설정하는 방법이 있습니다.

소스 수준 디버깅을 수행하려면 실행 가능 또는 공유 객체의 디버그 정보와 소스 코드가 필요합니다. Linux 및 Unix 배포판은 일반적으로 저장 공간을 절약하기 위해 기본적으로이 패키지를 포함하지 않지만 패키지로 제공합니다.

는에 CentOS에, 당신은 당신이 관심있는 각각의 실행 파일이나 라이브러리의 따라서 debuginfo 패키지를 설치해야합니다. 이렇게하려면 실행 debuginfo-install 프로그램을 설치합니다

sudo yum install yum-utils 

다음

을 실행
sudo debuginfo-install glibc 

glibc-debuginfo-2.5-123 패키지를 다운로드하여 설치하십시오 (버전 번호는 다를 수 있음). 이렇게하면 많은 파일 중에서 /usr/lib/debug/lib64/libc.so.6.debug, /usr/lib/debug/lib64/libc-2.5.so.debug/usr/src/debug/glibc-2.5-20061008T1257/stdlib/grouping.c이 필요한만큼 설치됩니다.

debuginfo-install은 debuginfo 저장소를 활성화하고 인수로 지정한 패키지에 해당하는 debuginfo 패키지와 모든 종속성을 다운로드하고 설치하는 짧은 python 프로그램입니다. 또는 http://debuginfo.centos.org (또는 다른 미러)에서 직접 debuginfo 패키지를 다운로드하여 rpm -i을 사용하여 설치할 수 있습니다.

을 설치할 수있는 debuginfo 패키지가 없습니다. 아마도 당신은 debuginfo repo를 구성하지 않았을 것입니다.내 CentOS는 5 시스템에서 구성이 다른 버전의 파일 /etc/yum.repos.d/CentOS-Debuginfo.repo

# 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 
# 

[base-debuginfo] 
name=CentOS-5 - Debuginfo 
baseurl=http://debuginfo.centos.org/5/$basearch/ 
gpgcheck=0 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 
enabled=0 

에는 따라서 debuginfo의 환매 특약을 추가하기위한 일반 지침 this CentOS wiki article에 있습니다.