LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Core dump issues. Program crashes but does not generate core dump file (https://www.linuxquestions.org/questions/programming-9/core-dump-issues-program-crashes-but-does-not-generate-core-dump-file-760360/)

sabeel_ansari 10-07-2009 12:38 PM

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

clvic 10-07-2009 04:23 PM

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?


All times are GMT -5. The time now is 03:29 PM.