您的位置:首页 > 运维架构 > Linux

linux 大量生成core dump文件

2014-06-10 15:24 120 查看
近日发现个别服务器大量生成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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: