如何生成在Ubuntu核心转储文件 [英] How to generate core dump file in Ubuntu

查看:171
本文介绍了如何生成在Ubuntu核心转储文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何生成在Ubuntu核心转储文件。我使用Ubuntu 8.04.1和gcc编译器4.2.3。我写了一个简单的C程序来生成一个核心转储。我已编译的程序中 - GCC -g badpointer.c。当我运行程序它给分段错误,但不会产生核心转储。什么额外的事情我必须做的,生成一个核心转储文件?

I would like to know how to generate a core dump file in Ubuntu. I am using Ubuntu 8.04.1 and gcc compiler 4.2.3. I have written a simple C program to generate a core dump. I have compiled the program as in -- gcc -g badpointer.c . When I run the program its gives segmentation fault but no core dump is generated. What additional things do i have to do to generate a core dump file ?

推荐答案

检查的ulimit -c 的输出中,如果输出0,这就是为什么你不具备核心转储。

Check the ouput of ulimit -c, if it output 0, this is why you don't have core dumped.

使用

的ulimit -c无限

要允许创建核心(也许替换无限由一个真正的大小限制是更安全)。

to allow core creation (maybe replace unlimited by a real size limit to be more secure) .

这篇关于如何生成在Ubuntu核心转储文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆