正如您所看到的,我正在使用 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; doneAs 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.
更多推荐
核心转储文件不会生成
发布评论