473,750 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

prevent dumping core file?

ken
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
Nov 14 '05 #1
10 4020
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.progr ammer 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)cybers pace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #2
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.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Immanuel Kant but Genghis Khan."
- The Official Graffitist's Handbook
Nov 14 '05 #3
Joona I Palaste <pa*****@cc.hel sinki.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.
Nov 14 '05 #4
nrk
rahul dev wrote:
Joona I Palaste <pa*****@cc.hel sinki.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.


I seriously doubt if there's a man page for core on a Linux system.
To prevent it from dumping the core file,you may create a directory
named
"core" in your working directory.


A better(?) solution is to use the ulimit (bash) or limit (csh/tcsh)
builtins to set the limit for coredumpsize to 0. To OP: man bash and
search for ulimit to see how this can be done.

-nrk.

--
Remove devnull for email
Nov 14 '05 #5
rahul dev <ra***********@ hotmail.com> wrote:
To prevent it from dumping the core file,you may create a directory
named
"core" in your working directory.


or simply set "ulimit -c 0" but that would only be the way it
was meant to be done.
Nov 14 '05 #6
ken wrote:
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


'limit core 0' in tcsh, or setrlimit() in the program itself. But
Murphy's Law is gonna GET you...

--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41

Nov 14 '05 #7
mi************* @peaktime.be wrote...
ken wrote:
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


'limit core 0' in tcsh, or setrlimit() in the program itself. But
Murphy's Law is gonna GET you...


'touch ./core ; chmod 000 ./core' trumps Murphy if '.' is the cwd of
the program dumping core.

--
http://www.howtobuyamerican.com/
Nov 14 '05 #8
nrk <ra*********@de vnull.verizon.n et> spoke thus:
I seriously doubt if there's a man page for core on a Linux system.


FWIW, the NetBSD system I'm on does have a man page for core, so who
knows...?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #9
nrk <ra*********@de vnull.verizon.n et> wrote in message news:<bL******* ********@nwrddc 02.gnilink.net> ...
rahul dev wrote:
Joona I Palaste <pa*****@cc.hel sinki.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.


I seriously doubt if there's a man page for core on a Linux system.
To prevent it from dumping the core file,you may create a directory
named
"core" in your working directory.


A better(?) solution is to use the ulimit (bash) or limit (csh/tcsh)
builtins to set the limit for coredumpsize to 0. To OP: man bash and
search for ulimit to see how this can be done.

-nrk


Another way is to symbolically link "core" to "/dev/null".
For those who don't need to search for ulimit in the man pages.
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4954
by: Ganesh Gella | last post by:
Hi All, I am using g++ on Linux, and my code has lot of vectors each stores a particualr type of structure. (Structure internally had some vectors). When I am trying to push_back an element to a one of the vectors in the parent strutcure, it always core dumps on Linux and HP. On Solaris the same code is working fine without any problem. My code is actually an API, and this problem is seen only by few
1
5593
by: Martin | last post by:
I got a core from my client but i am not able to find out where it crashed. I got the following: From my experience, when i got lots of warning which complains about the path mismatch.. I can use "pathmap" to tell dbx the new path of the libraries and then use "where" to find out where it crashed. however, this time, the DBX itself crashed. I can no way to use pathmap. Can any guru kindly tell me what i can do to debug the core? How can...
6
1985
by: Greg Brant | last post by:
Hi, how can i backup a table / entire DB and get the index's as well as the data / create table's etc cheers Greg
1
3508
by: Martin | last post by:
I use dbx and i got the following error: Reading GL_CliConnMgr core file header read successfully Reading ld.so.1 dbx: core file read error: address 0xff3e6000 not available dbx: core file read error: address 0xff3e70a0 not available dbx: warning: could not initialize librtld_db.so.1 -- trying libDP_rtld_db.so Make sure this is the same version of Solaris where the core dump
25
3996
by: Dave Turner | last post by:
I know that its impossible to completely prevent somebody from ripping a site (or cracking software) if that person has the skills and the time/patience, but there are tricks that can be employed in software which slow crackers down, from things like self-decrypting code to anti-debug tricks, and most people have a breaking point - if you can slow them down and waste enough of their time they usually move on to easier targets (and as there...
7
16642
by: L Mehl | last post by:
Hello -- In a form text field for entering stock symbols, I want to allow only: alpha integer decimal backspace left and right arrows delete shift
5
4064
by: su | last post by:
to find which process dumped core at the promt we give $ file core.28424 core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11), Intel 80386, version 1 (SYSV), from 'soffice.bin' from this command we know 'soffice.bin' process dumped core. Now can i do the same using python i.e. finding which process dumped core? if so how can i do it?
15
2959
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility, controlled via Plesk control panel, and turned over to me with Fedora Core 6 in an empty state. This is the standard way you get a server in a colo today. Bringing Python up in this completely clean environment is a huge hassle, and it doesn't...
2
3702
by: Zach | last post by:
I compiled a game client and it crashed (segmentation fault) resulting in a core file being generated. I'm trying to find out exactly what caused it to crash. Any ideas how I can do this with gdb? In the Makefile can I just add a "-g" flag to have the binary produced with debugging symbols? The source is written in ANSI C. This is what I have now: "CC = gcc" The client binary is 433680 and the core file produced when it crashed
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.