防止转储核心文件? [英] prevent dumping core file?

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

问题描述

你好,

我正在linux系统上编写一个c程序。我正在调试分段

故障,但我不希望它转储核心文件,因为该程序的内存足够
足迹超过300Mb我不喜欢每次我添加一个新的printf语句来调试代码时,都不需要它来生成一个
300Mb的文件。


我可以做些什么来阻止它从倾销核心文件,即使它是
seg fault? (这是unix / linux的东西,还是ac的东西?)


谢谢!

ken

解决方案

ken< ke*@nospam.com>这样说了:

我能做些什么来阻止它转储核心文件,即使它有错误吗? (这是unix / linux的东西,还是ac的东西?)




(这是* nix的东西.comp.unix.programmer可能有用。)


您的帖子对于comp.lang.c来说是偏离主题的。请访问

http://www.csclub.uwaterloo.ca/u/dj3...lc-welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html


用于发布指南和常见问题解答。谢谢。


-

Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我

ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。


ken< ke*@nospam.com>潦草地写道:

你好,我正在linux系统上编写一个c程序。我正在调试分段故障,但我不希望它转储核心文件,因为程序的内存足迹超过300Mb而且我不需要它来生成
每次添加一个新的printf语句来调试代码时300Mb文件。
我可以做些什么来阻止它转储核心文件,即使它有错误吗? (这是unix / linux的东西,还是ac的东西?)




这是Unix / Linux的东西。


-

/ - Joona Palaste(pa*****@cc.helsinki.fi)-------------芬兰------ - $ \\

\ - http:// www .helsinki.fi / ~palaste ---------------------规则! -------- /

Immanuel Kant但Genghis Khan。

- 官方格拉菲斯特手册


Joona I Palaste< pa ***** @ cc.helsinki.fi>在消息新闻中写道:< bu ********** @ oravannahka.helsinki.fi> ...

ken< ke*@nospam.com>潦草地写道:

你好,我正在linux系统上编写一个c程序。我正在调试分段故障,但我不希望它转储核心文件,因为程序的内存足迹超过300Mb而且我不需要它来生成
每次添加一个新的printf语句来调试代码时都有300Mb文件。


我可以做些什么来阻止它转储核心文件,即使它是
seg故障? (这是unix / linux的东西,还是ac的东西?)



这是Unix / Linux的东西。




这确实是一个linux的事情。 C与转储核心

文件无关。

linux内核写出一个包含

终止进程核心映像的文件当收到某些信号时。核心图片

文件在进程的工作目录中写成
。有关更多信息,您可以

查看核心的手册页。

为了防止它转储核心文件,您可以创建一个目录

名为

" core"在你的工作目录中。


hello,
i''m writing a c program on a linux system. i''m debugging a segmentation
fault but i don''t want it to dump a core file because the memory
footprint of the program is over 300Mb and i don''t need it to generate a
300Mb file every time I add a new printf statement to debug the code.

can i do something to prevent it from dumping the core file even when it
seg faults? (is this a unix/linux thing, or a c thing?)

thanks!
ken

解决方案

ken <ke*@nospam.com> spoke thus:

can i do something to prevent it from dumping the core file even when it
seg faults? (is this a unix/linux thing, or a c thing?)



(It''s a *nix thing. comp.unix.programmer might be useful.)

Your post is off-topic for comp.lang.c. Please visit

http://www.csclub.uwaterloo.ca/u/dj3...lc-welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.


ken <ke*@nospam.com> scribbled the following:

hello,
i''m writing a c program on a linux system. i''m debugging a segmentation
fault but i don''t want it to dump a core file because the memory
footprint of the program is over 300Mb and i don''t need it to generate a
300Mb file every time I add a new printf statement to debug the code. can i do something to prevent it from dumping the core file even when it
seg faults? (is this a unix/linux thing, or a c thing?)



It''s a Unix/Linux thing.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Immanuel Kant but Genghis Khan."
- The Official Graffitist''s Handbook


Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<bu**********@oravannahka.helsinki.fi>...

ken <ke*@nospam.com> scribbled the following:

hello,
i''m writing a c program on a linux system. i''m debugging a segmentation
fault but i don''t want it to dump a core file because the memory
footprint of the program is over 300Mb and i don''t need it to generate a
300Mb file every time I add a new printf statement to debug the code.


can i do something to prevent it from dumping the core file even when it
seg faults? (is this a unix/linux thing, or a c thing?)



It''s a Unix/Linux thing.



It is indeed a linux thing. C has nothing to do with dumping a core
file.
The linux kernel writes out a file containing a core image of a
terminated process when certain signals are received. The core image
file is written
in the process''s working directory. For more information you may
see the man page of core.
To prevent it from dumping the core file,you may create a directory
named
"core" in your working directory.


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

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