1. 开启coredump
ulimit -c unlimited
2. vim /etc/sysctl.conf 添加如下,然后执行sysctl -p
1 2 |
|
3. chmod 777 /usr/local/sbin/core_helper , core_helper如下
1 2 3 |
|
实验:
生成的core文件如下:
可以通过gzip -d xxx.gz解压出core文件,然后使用gdb -c ***.core /xxx/xxx/test(你的可执行文件)