Linux平台下的core file分析

转载自CSDN博客:http://blog.csdn.net/gobitan/article/details/5644151

第一步:找到core file是由哪个程序产生的

[[email protected] dennis]# file core.11751

core.11751: ELF 64-bit LSB core file AMD x86-64, version 1 (SYSV), SVR4-style, from ‘Java

[[email protected] dennis]#

从上面可以看出,该core file是由java产生的。

第二步:用gdb调试器找到问题所在,执行如下命令

[[email protected] dennis]# gdb Javacore.11751

GNU gdb Fedora (6.8-27.el5)

Copyright (C) 2008 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-redhat-linux-gnu"...

(no debugging symbols found)

Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.

Loaded symbols for /lib64/libpthread.so.0

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/jli/libjli.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/bin/../lib/amd64/jli/libjli.so

Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.

Loaded symbols for /lib64/libdl.so.2

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

Loaded symbols for /lib64/libc.so.6

Reading symbols from /lib64/ld-linux-x86-64.so.2...

(no debugging symbols found)...done.

Loaded symbols for /lib64/ld-linux-x86-64.so.2

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so

Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.

Loaded symbols for /lib64/libm.so.6

Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.

Loaded symbols for /lib64/librt.so.1

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libverify.so...

(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libverify.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libjava.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libjava.so

Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done.

Loaded symbols for /lib64/libnsl.so.1

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/native_threads/libhpi.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/native_threads/libhpi.so

Reading symbols from /lib64/libnss_files.so.2...

(no debugging symbols found)...done.

Loaded symbols for /lib64/libnss_files.so.2

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libzip.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libzip.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libnet.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libnet.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/librmi.so...(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/librmi.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libnio.so...

(no debugging symbols found)...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libnio.so

Reading symbols from /opt/nawg/lib/libheadercodecJNI.so...(no debugging symbols found)...done.

Loaded symbols for /opt/nawg/lib/libheadercodecJNI.so

Reading symbols from /opt/nawg/lib/libwpss_wsl.so.1...done.

Loaded symbols for /opt/nawg/lib/libwpss_wsl.so.1

Reading symbols from /opt/nawg/lib/libwpss_hc.so.2...done.

Loaded symbols for /opt/nawg/lib/libwpss_hc.so.2

Reading symbols from /opt/nawg/lib/libwss_wenc.so...done.

Loaded symbols for /opt/nawg/lib/libwss_wenc.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/libawt.so...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/libawt.so

Reading symbols from /usr/java/jre1.6.0_19/lib/amd64/headless/libmawt.so...done.

Loaded symbols for /usr/java/jre1.6.0_19/lib/amd64/headless/libmawt.so

Reading symbols from /opt/nawg/lib/libWIAwmlsencoder.so...done.

Loaded symbols for /opt/nawg/lib/libWIAwmlsencoder.so

Reading symbols from /opt/nawg/lib/libWIAhtml2xhtml.so...done.

Loaded symbols for /opt/nawg/lib/libWIAhtml2xhtml.so

Reading symbols from /opt/nawg/lib/libcapcodecJNI.so...done.

Loaded symbols for /opt/nawg/lib/libcapcodecJNI.so

Reading symbols from /opt/nawg/lib/libwpss.so.4...done.

Loaded symbols for /opt/nawg/lib/libwpss.so.4

Reading symbols from /opt/nawg/lib/libserverJNI.so...done.

Loaded symbols for /opt/nawg/lib/libserverJNI.so

Reading symbols from /opt/nawg/lib/libwpss_crypto.so.1...done.

Loaded symbols for /opt/nawg/lib/libwpss_crypto.so.1

Reading symbols from /opt/nawg/lib/libcrypto.so.0.9.8...done.

Loaded symbols for /opt/nawg/lib/libcrypto.so.0.9.8

Reading symbols from /usr/lib/Oracle/10.2.0.2/client/lib/libocijdbc10.so...done.

Loaded symbols for /usr/lib/oracle/10.2.0.2/client/lib/libocijdbc10.so

Reading symbols from /usr/lib/oracle/10.2.0.2/client/lib/libclntsh.so.10.1...done.

Loaded symbols for /usr/lib/oracle/10.2.0.2/client/lib/libclntsh.so.10.1

Reading symbols from /usr/lib/oracle/10.2.0.2/client/lib/libnnz10.so...done.

Loaded symbols for /usr/lib/oracle/10.2.0.2/client/lib/libnnz10.so

Reading symbols from /usr/lib/oracle/10.2.0.2/client/lib/libociicus.so...done.

Loaded symbols for /usr/lib/oracle/10.2.0.2/client/lib/libociicus.so

Core was generated by `java -server -DWAPHOME=/opt/nawg/log/wps_var -DsystemRoot=/opt/nawg -DsystemBin‘.

Program terminated with signal 6, Aborted.

[New process 12593]

[New process 22363]

【中间省略掉了】

[New process 11752]

[New process 11751]

#0  0x00002b08894f4215 in raise () from /lib64/libc.so.6

然后执行bt命令

(gdb) bt

#0  0x00002b08894f4215 in raise () from /lib64/libc.so.6

#1  0x00002b08894f5cc0 in abort () from /lib64/libc.so.6

#2  0x00002b0889df13d7 in os::abort () from /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so

#3  0x00002b0889f2a50d in VMError::report_and_die () from /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so

#4  0x00002b0889df74c1 in JVM_handle_linux_signal () from /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so

#5  0x00002b0889df3cfe in signalHandler () from /usr/java/jre1.6.0_19/lib/amd64/server/libjvm.so

#6  <signal handler called>

#7  0x00002aaaec5dd0bd in declex (yylval=<value optimized out>, DecParam=0x572dd840) at lex_dec.c:7997

#8  0x00002aaaec5e15c5 in decparse (DecParam=0x572dd840) at yacc_dec.c:1008

#9  0x00002aaaec5d4ff1 in HC_DecodeHeader (Context=0x564b62f0, WspHeader=<value optimized out>, WspHeaderLength=4096,

ContentLength=0, HttpHeader=0x5636a390 "B$¨éB$: /r/n", HttpHeaderLength=0x43caa814) at hc_decoder.c:2517

#10 0x00002aaaec3b2dbe in Java_com_nokia_wap_filter_headercodec_HeaderCodec_cDecode ()

from /opt/nawg/lib/libheadercodecJNI.so

#11 0x00002aaaab866058 in ?? ()

#12 0x0000000043caa8b0 in ?? ()

#13 0x0000000000000000 in ?? ()

(gdb)

从上面bt命令获取到的堆栈信息来看,可以清晰地看到问题所在的源代码的行数,即:

hc_decoder.c:2517

这样就便于分析和定位问题。

参考文献:

(1)http://www.dialogic.com/support/helpweb/dxall/tn957.aspx

(2)http://www.sun.com/bigadmin/jsp/descFile.jsp?url=descAll/sun_gdd__all__pkg_a

时间: 2024-12-20 06:36:35

Linux平台下的core file分析的相关文章

在linux平台下,设置core dump文件属性(位置,大小,文件名等)

在linux平台下,设置core dump文件生成的方法: 1) 在终端中输入ulimit -c 如果结果为0,说明当程序崩溃时,系统并不能生成core dump. 2) 使用ulimit -c unlimited命令,开启core dump功能,并且不限制生成core dump文件的大小.如果需要限制,加数字限制即可.ulimit - c 1024 3) 默认情况下,core dump生成的文件名为core,而且就在程序当前目录下.新的core会覆盖已存在的core.通过修改/proc/sys

Linux平台下Java_Android开发环境的搭建

Linux 平台下安装JDK .Eclipse .Android SDK 说明 开发工具需自行去下载,此处就不再累述 该教程安装环境为 Ubuntu 14.04 x64 其他Linux操作方式基本相同 设计文件修改部分,请先备份要修改的文件,避免操作失误导致不能还原 Liunx 平台下区分大小写,输入文件名或路径建议复制避免不必要的错误 部分操作涉及root权限,为了避免麻烦 请直接使用 root权限操作 开启root权限: 1. sudo su root 2. 后面的提示中输入用户密码 安装

Linux平台下:块设备、裸设备、ASMlib、Udev相关关系

对磁盘设备(裸分区)的访问方式分为两种:1.字符方式访问(裸设备):2.块方式访问 Solaris平台 : 在Solaris平台下,系统同时提供对磁盘设备的字符.块方式访问.每个磁盘有两个设备文件名: 一个在/dev/dsk目录下,比如/dev/dsk/c1t1d1s1,当以这个设备名操作时,就是以块的方式操作磁盘: 一个在/dev/rdsk目录下,比如/dev/rdsk/c1t1d1s1,当以这个设备名操作时,就是以字符方式(裸设备方式r)操作磁盘 Linux平台 : 在linux平台下,缺省

关于Linux平台下的ZFS文件系统最新情况

Linux平台下的ZFS文件系统分类两个,一个是在用户空间实现的ZFS,一个是通过内核模块实现的ZFS. 用户空间实现的ZFS已经好几年没人维护了,且不说稳定性,单是性能就无法用,相关开发人员已放弃. 内核空间实现的ZFS一直在维护,美国有相关机构在内部使用,按照zfsonlinux上的开发者所说,早已经稳定了,可以在线上使用,但国内使用的人还是寥寥.可能最大的问题就是,由于Solaris自身发布协议和专利纠纷的限制,此项目的代码仍是基于CDDL发布的,因而不会进入主线内核,所以大家普遍感觉不是

Linux平台下Python的安装及IDE开发环境搭建

Linux平台下Python的安装及IDE开发环境搭建 1.Python安装 Python有2.X和3.X两个版本,由于2.X的版本较稳定,使用者也较多,本文选择使用Python 2.X版本. 安装步骤: (1) 下载Python安装包:https://www.python.org/downloads/ (2)  解压安装包:tar zxvf Python-2.7.10.tgz (3)  编译:./compile (4)  安装:make && make install 说明: ① 这样p

linux平台下Oracle database的安装与/etc/redhat-release

linux平台下,在安装oracle10.2.0.1的时候,不要修改/etc/redhat-release的内容. 而是要用runInstaller的一个参数去解决:-ignoreSysPreReqs.因为emc的多路径软件在安装时会读取该文件的内容,错误的内容会导致emc多路径软件安装失败.这也算是一个最佳实践吧. 版权声明:本文为博主原创文章,未经博主允许不得转载.

linux平台下Hadoop下载、安装、配置

在这里我使用的linux版本是CentOS 6.4 CentOS-6.4-i386-bin-DVD1.iso 下载地址: http://mirrors.aliyun.com/centos/6.8/isos/i386/ 0.使用host-only方式 将Windows上的虚拟网卡改成跟linux上的网卡在同一个网段上 注意:一定要将windowsh 的WMnet1的ip设置和你的虚拟机在同一网段,但是ip不一样 一.前期工作: 1.修改linux ip 手动修改 也可以命令修改 vim /etc/

linux平台下server运维问题分析与定位

结合我工作中碰到的运维问题,总结一下Linux下server常见的运维问题以及定位方式.这里的server主要指自主开发的逻辑server,web srv因为通常采用通用的架构所以问题比较少. 逻辑server通常的处理能力在3k/s - 1w/s之间,因业务特点而不同.逻辑server一般是自主开发的,虽然在上线前大都经过功能和压力测试,但放到现网环境上部署后还是难免会出现一些问题,有些问题是在灰度发布时就可以发现,而有些问题则是一个漫长的暴露过程.下面先总结一下大致的问题分类和定位方法.  

Linux平台下GCC和GDB的使用注意点

在学习<大话数据结构>的链式二叉树结构时,我不经意对作者的源码做了一些修改,将原本的ABDH#K###E##CFI###G#J##改成了ABD##CR##(#代表NULL),当时改的时候没有考虑到二叉树构造的合理性问题,事实上,后者是不符合规范的,所以编译运行之后,GCC出现了"段错误 (核心已转储)"这么一个错误提示.而当时我以为是源代码有问题,因此首先想到的便是分析源码的正确性. 正是这么一个乌龙,使我遇到了层出不穷的问题. 为了测试主程序的正确性,我先写了一段简单的测