Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-07-2009, 12:38 PM   #1
LQ Newbie
Registered: Nov 2000
Location: ottawa, canada
Posts: 18

Rep: Reputation: 0
Core dump issues. Program crashes but does not generate core dump file


I want to generate core dump files from my program when it crashes. Its a pretty big process and has about 10-11 threads in it.

I have followed the documentation to enable core dump by setting ulimit to unlimited etc. I quickly tried "A demo program creating a core dump" from the following webpage, which succeeds in Segfault and dumping a core file in the directory that I configured.

However, I tried running my original program and caused it to crash. I did this by making calls to kill(), raise() or the same null pointer access as shown in the webpage above. In each case, my program crashed but did not generate a core dump file. Am I missing something?

My program is in C++ and my environment is Redhat 9.0 (kernel 2.4.20)

Going through the "Why do I NOT get a core dump?" section on the same webpage as above, I can see two potential problems. One - there are issues with the suid/sgid (bullet # 6). I am not able to change any settings with suid because my system does not contain either /proc/sys/fs/suid_dumpable or /proc/sys/kernel/suid_dumpable

Two, my program has threads in it and the bullet # 8 is the problem. Any thoughts on how to solve this would be much appreciated.

thanks in advance
Old 10-07-2009, 04:23 PM   #2
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
I'm sorry, I'll ask you two silly questions, before looking at the interesting questions you pointed out.
1) are you sure you're looking for the core file in the right directory? Core dumps should be in the program's current directory, that is, the directory from where the program starts, that can be changed at runtime by call to chdir()
2) are you sure your program is actually running in the environment which you set with the use of ulimit? I remember that ulimit sets the parameters for the current bash environment... are you starting your program in the same shell as ulimit?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Core Dump on Solaris (Question about core file) dayalan_cse Solaris / OpenSolaris 5 12-29-2014 07:56 AM
Core dump in Ubuntu 8.04 (Empty core file) vineet7kumar Linux - Newbie 1 01-17-2009 05:52 PM
Process crashes and does not dump core traene Programming 4 10-13-2008 03:37 PM
How to generate a core dump programmatically? mistretzu Programming 1 07-18-2008 09:06 AM
Tux Racer crashes X... where is the core dump? trusted_content Linux - General 4 06-08-2003 07:08 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration