linux 大量生成core dump文件

近日发现个别服务器大量生成core文件,以前一直没有注意这个问题,

经过排查发现,这些服务器设置了 ulimit -c unlimited

经过查找

$HOME/.bash_profile

$HOME/.bashrc 

/etc/profile

删除了该命令,通过系统默认的:

vi /etc/profile

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

vi /etc/init.d/functions
corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}"

${DAEMON_COREFILE_LIMIT:-0}表示如果$DAEMON_COREFILE_LIMIT为空则取默认值0.注意 :- 是必须要有的。


core文件 是 core.xxx xxx表示产生异常的pid

可以通过 gdb exefile corefile 进行查看。

相关命令: bt (backtrack) fr num eg., 0 1 2(frame) 等

相关资料如下

HowTo: Debug Crashed Linux Application Core Files Like A Pro

http://www.cyberciti.biz/tips/linux-core-dumps.html

HOWTO enable core-dumps

http://en.linuxreviews.org/HOWTO_enable_core-dumps

How do I enable core dumps for everybody

http://www.akadia.com/services/ora_enable_core.html

Linux core dump file详解

http://blog.chinaunix.net/uid-26707720-id-3256694.html


How to Produce a Core File from Your Program

http://sourceware.org/gdb/download/onlinedocs/gdb/Core-File-Generation.html#Core-File-Generation

GDB + Core file dump

http://stackoverflow.com/questions/5150481/gdb-core-file-dump

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值