My program is written in C++. compiled with gcc, using -g3 -O0 -ggdb flags. When it crashes, I want to open its core dump. Does it create core dump file, or I need to do something to enable core dump creation, in the program itself, or on computer where it is executed? Where this file is created, and what is its name?
+1
A:
You need to set ulimit -c
. If you have 0 for this parameter a coredump file is not created. So do this: ulimit -c unlimited
and check if everything is correct ulimit -a
. The coderdump file is created when an application has done for example something inappropriate. The name of the file on my system is core.<process-pid-here>
.
skwllsp
2010-05-27 08:02:54
Thanks, I executed "ulimit -c unlimited" from the terminal window (Ubuntu), then executed my program from the same window, and it created core dump. How can I make this mode default? When I execute my program from keyboard shortcut, dump is not created.
Alex Farber
2010-05-27 08:10:53
1) `setrlimit` is a way to set the core file size from your program. 2) Or set `ulimit -c unlimited` in your profile.
skwllsp
2010-05-27 08:28:06
Place the line in your `~/.profile`.
Philipp
2010-05-27 08:38:27
+1
A:
By default many profiles are defaulted to 0 core file size because the average user doesn't know what to do with them.
Try ulimit -c unlimited
before running your program.
msw
2010-05-27 08:03:59