core搭建

core搭建

  1. 配置 /etc/profile

    添加: ulimit -c unlimited

  2. echo "1" > /proc/sys/kernel/core_uses_pid

  3. 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          # 添加命令名
    
  4. 测试 kill -s SIGSEGV 12345(pid)

原文地址:https://www.cnblogs.com/maomaomaoge/p/15064939.html