核心转储文件不会生成

编程入门 行业动态 更新时间:2024-10-26 06:33:49
本文介绍了核心转储文件不会生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 每次,我的应用程序崩溃核心转储文件不会生成。我记得几天前,在另一台服务器上生成了。

#!/ 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.

更多推荐

核心转储文件不会生成

本文发布于:2023-11-14 16:36:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587976.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:核心   储文

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!