LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-07-2009, 01:38 PM   #1
sabeel_ansari
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


Hello,

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.

http://www.shinguz.ch/MySQL/mysql_hunting_the_core.html

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
sabeel
 
Old 10-07-2009, 05:23 PM   #2
clvic
Member
 
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?
 
  


Reply


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
[SOLVED] Process crashes and does not dump core traene Programming 5 03-09-2024 04:28 AM
Core Dump on Solaris (Question about core file) dayalan_cse Solaris / OpenSolaris 5 12-29-2014 08:56 AM
Core dump in Ubuntu 8.04 (Empty core file) vineet7kumar Linux - Newbie 1 01-17-2009 06:52 PM
How to generate a core dump programmatically? mistretzu Programming 1 07-18-2008 10:06 AM
Tux Racer crashes X... where is the core dump? trusted_content Linux - General 4 06-08-2003 08:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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