核心转储文件不会生成 [英] Core dump file is not generated
问题描述
#!/ bin / bash
ulimit -c我使用bash运行应用程序,如下所示:无限
而真实;做./server;完成
正如您所看到的,我正在使用 ulimit -c unlimited code>如果我想生成一个核心转储,但是它仍然不会生成它,这在我遇到分段错误时非常重要。
如何使它工作?
确保您的当前目录(在崩溃时 - code> server 可能会改变目录)是可写的。如果服务器调用 setuid
,那么该目录必须是该用户可写的。
同时检查的/ proc / SYS /内核/ core_pattern
。这可能会将核心转储重定向到另一个目录,并且 目录必须是可写的。更多信息此处。
Every time, my application crash a core dump file is not generated. I remember that few days ago, on another server it was generated. I'm running the app using screen in bash like this:
#!/bin/bash
ulimit -c unlimited
while true; do ./server; done
As you can see I'm using ulimit -c unlimited
which is important if I want to generate a core dump, but it still doesn't generate it, when I got an segmentation fault.
How can I make it work?
Make sure your current directory (at the time of crash -- server
may change directories) is writable. If the server calls setuid
, the directory has to be writable by that user.
Also check /proc/sys/kernel/core_pattern
. That may redirect core dumps to another directory, and that directory must be writable. More info here.
这篇关于核心转储文件不会生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!