我在 ubuntu 18.04 和 ubuntu 20.04 中找不到任何核心转储文件,即使我已经更改core file size并且/proc/sys/kernel/core_pattern:
smart@stable:~$ ulimit -c unlimited
smart@stable:~$ ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63699
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1048576
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
smart@stable:~$ cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c %d %P %E
smart@stable:~$ sudo su
root@stable:~# echo "/var/carsh/core-%e-%p-%t" > /proc/sys/kernel/core_pattern
完成这一切之后,我运行了一个程序,它会得到一个 Segmentation fault 错误,但它没有在 中生成 core-dump 文件/var/carsh/,那有什么问题呢?