Where does the log get written when there's a core dump?

Adam D. Ruppe destructionator at gmail.com
Tue May 28 14:15:54 PDT 2013


On Tuesday, 28 May 2013 at 21:06:14 UTC, Gary Willoughby wrote:
> playing and I got a message of a seg fault and a core dump 
> written to a log.

like this?

Segmentation fault (core dumped)


That's actually more of a linux thing than a D thing. The file 
will be called "core" in the current directory. If your 
executable file was called test, you can check out the core dump 
with gdb like this:

  gdb ./test core


$ ulimit -c 50000 # enable core dumps, see man bash for more info
$ ./test # this program writes to a null pointer
Segmentation fault (core dumped)

$ ls -lh core # newly created
-rw------- 1 me users 1.4M 2013-05-28 17:13 core

$ gdb ./test core # load the thing in the debugger
/* snip some irrelevant stuff */
Core was generated by `./test'.
Program terminated with signal 11, Segmentation fault.
#0  0x0805ca31 in _Dmain ()
(gdb)


More information about the Digitalmars-d-learn mailing list