开发者

Generating Mini Text Dump LInux

Following question describe for windows H开发者_如何学编程ow to create minidump for my process when it crashes?

But how can I create mini crash text dump on linux ?


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


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:

ulimit -c unlimited

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:

kill -6 <pid>

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜