Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Why there is no core file when a Segmentation fault occured!

Posted on 2001-09-09
5
Medium Priority
?
481 Views
Last Modified: 2012-08-14
I have a program, i can debug with the core file  when a segmenttation fault occured, but how can i debug when there is no core file?
0
Comment
Question by:sandy_wu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:BlackDiamond
ID: 6472524
If you're using gdb, you can step through the program line by line to see where it bombs.  You can also use breakpoints if it is a large app (to narrow down the location).  

Also, a good practice is to write wrappers around anything that deals with memory (malloc, calloc, realloc, etc.) that do error checking and give useful errors.

If your wrappers don't catch the errors, then you can narrow it down to pointer math errors.  Then use a debugger (or print statements if you have to) to pinpoint the location in your app.
0
 

Author Comment

by:sandy_wu
ID: 6473086
Thank U BlackDiamond, but what I mean is Why there is no core file when a Segmentation fault occured? and sometime it has!
0
 
LVL 5

Accepted Solution

by:
BlackDiamond earned 150 total points
ID: 6475105
Sorry, I didn't look at the question in the header.  It is probably because the core file generated would be larger than your ulimit.  Try the command "ulimit -c unlimited", and see if it generates the cores consistently.

Also, another useful program for debugging is "strace".
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6475917
use following syntax:

bash% ulimit -c unlimited
 ksh% ulimit -c unlimited
  sh% ulimit -c unlimited
tcsh% limit coredumpsize unlimited
 csh% limit coredumpsize unlimited
keep in mind that this may produce huge core files, which also may take sevaral minutes to complete
0
 

Author Comment

by:sandy_wu
ID: 6475955
Thank U BlackDiamond, and thank U ahoffmann, both of U are right, and ahoffmann is more detail.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question