生成迷你文本转储 LInux
以下问题针对 Windows 进行描述 如何在进程崩溃时为其创建小型转储?< /a>
但是如何在 Linux 上创建小型崩溃文本转储?
Following question describe for windows
How to create minidump for my process when it crashes?
But how can I create mini crash text dump on linux ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要编写一个信号处理程序。
以下是有关如何执行此操作的幻灯片:
http://www.scribd.com/doc/3726406/Crash-N-Burn-Writing-Linux-application-fault-handlers
这是代码形成幻灯片:
https://github.com/gby/libcrash
You need to write a signal handler.
Here is a slide deck on how to do it:
http://www.scribd.com/doc/3726406/Crash-N-Burn-Writing-Linux-application-fault-handlers
Here is the code form the slide deck:
https://github.com/gby/libcrash
我不确定您能否获得与 .NET MiniDump 完全相同的东西 - 但您将能够在 Linux 上生成核心转储,该核心转储应该会获得您想要的信息。确保通过发出如下命令来启用核心文件:
这还将设置核心转储的最大大小为
无限制
- 您可以根据需要进行定制,以实现“迷你”方面你的问题。man ulimit
是你的朋友。然后,运行您的进程,并在它运行时将其杀死。我通常发送的信号是
SIG_ABRT
(信号 6),如下所示:如果您不知道 pid 是什么,或者如何获取 pid,您可能需要阅读更多有关 Linux 的内容。
I'm not sure you can get the exact same thing as a .NET MiniDump - but you will be able to produce a core dump on Linux that should get the information you are after. Make sure that core files are enabled by issuing a command such as:
This will also set the maximum size of core dumps to be
unlimited
- you can tailor this as you wish to achieve the 'mini' aspect of your question.man ulimit
is your friend here.Then, run your process and while you it is running kill it. The signal I usually send is
SIG_ABRT
(Signal 6) as so:If you don't know what the pid is, or how to get a pid, you probably need to read up some more on Linux.