如何在Linux中为每个进程进行核心转储?


Answers:


1

你需要改变这些

用ulimit检查你当前的核心限制

root@x:/tmp# ulimit -c
0

0表示不生成核心

root@x:/tmp# ulimit -c unlimited

将其设置为无限制或任何其他值(这是核心文件的最大大小)

root@x:/tmp# ulimit -c
unlimited
root@x:/tmp# 

root@x:/tmp# 
root@x:/tmp# ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
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) unlimited
v    irtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
root@x:/tmp# 

这将改变当前会话的核心限制。您需要在/etc/init.d [文件名取决于分发]中添加它,以便在计算机启动时设置这些值。


但转储只创造了不基于我的知识和正常进程守护进程stackoverflow.com/questions/8789214/...
Svisstack

不,任何过程都可以生成coredump。
daya
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.