core搭建
-
配置
/etc/profile
添加:
ulimit -c unlimited
-
echo "1" > /proc/sys/kernel/core_uses_pid
-
echo "/corefile/core-%e-%p-%t" > proc/sys/kernel/core_pattern
# core参数 %p : insert pid into filename # 添加pid %u : insert current uid into filename # 添加当前uid %g : insert current gid into filename # 添加当前gid %s : insert signal that cased the coredump into the file # 添加导致产生core的信号 %t : insert UNIX time that the coredump occurred into file# 添加core文件生成时的unix时间 %h : insert hostname where the coredump happened into file# 添加主机名 %e : insert coredumping executablename into file # 添加命令名
-
测试
kill -s SIGSEGV 12345(pid)