我正在容器中运行一个进程(一个服务)。几分钟后,进程停止(或崩溃),但没有生成核心转储。
当我试图有意创建一个核心转储(例如:在我的程序中除以10/0)时,它会创建一个内核转储。
但相同的进程(没有故意崩溃)将停止,并且不会创建核心转储。
可能是什么问题?
以下是我在VPS上的内核的更具体的细节:
[root@test101 ~]# sysctl -a |egrep -i "core"
kernel.core_uses_pid = 1
kernel.core_pattern = core.%e.%p
kernel.core_pipe_limit = 4
net.core.somaxconn = 128
net.core.xfrm_aevent_etime = 10
net.core.xfrm_aevent_rseqth = 2
net.core.xfrm_larval_drop = 1
net.core.xfrm_acq_expires = 30
net.core.wmem_max = 131071
net.core.rmem_max = 131071
net.core.wmem_default = 133120
net.core.rmem_default = 133120
net.core.dev_weight = 64
net.core.netdev_max_backlog = 1000
net.core.message_cost = 5
net.core.message_burst = 10
net.core.optmem_max = 20480
net.core.rps_sock_flow_entries = 0
net.core.netdev_budget = 300
net.core.warnings = 1
[root@test101 ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 8041
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
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
在/etc/security/limits.conf:中添加以下行
- 软核无限制
- 硬核无限制根软芯无限root硬核无限