【问题标题】:Process stops without creating core dump on OpenVZ Container进程停止而不在 OpenVZ 容器上创建核心转储
【发布时间】:2012-04-06 18:26:09
【问题描述】:

我正在容器中运行一个进程(一项服务)。几分钟后,进程停止(或崩溃),但没有生成核心转储。

当我尝试有意创建一个核心转储(例如:在我的程序中划分 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

【问题讨论】:

  • 您是如何确定您的程序确实异常崩溃/终止的?它可以正常终止吗?
  • 它是一个在无限循环中运行的守护进程,我很确定它没有正常退出,除非我要求它这样做。 :-) 而且这只发生在 OpenVZ 环境中。
  • 没有实际代码很难预测任何事情。你可以粘贴你的代码吗?如果允许?
  • 为什么不通过调试器运行它?调试器也可以捕获 SISSEGV 和其他信号

标签: linux-kernel coredump openvz


【解决方案1】:

在您的 /etc/security/limits.conf 中添加以下行:

  • 软核无限
  • 硬核无限 根软核无限 根硬核无限

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-14
    • 1970-01-01
    • 1970-01-01
    • 2020-10-27
    • 1970-01-01
    • 2016-04-22
    相关资源
    最近更新 更多