如何生成在Ubuntu核心转储文件

编程入门 行业动态 更新时间:2024-10-26 12:30:16
本文介绍了如何生成在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核心转储文件

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

发布评论

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

>www.elefans.com

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