段错误生成core.xxx文件方便定位

开启core, 采集程序崩溃端状态

vi /etc/profile

ulimit -S -c unlimited > /dev/null 2>&1

source /etc/profile

将崩溃文件记录下来

vi /etc/sysctl.conf

kernel.core_pattern = ./core_%t_%p_%e

kernel.core_uses_pid = 1

sysctl -p /etc/sysctl.conf

gdb 程序名 core.2

原文地址:https://www.cnblogs.com/rohens-hbg/p/13615403.html