www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Where does the log get written when there's a core dump?

reply "Gary Willoughby" <dev kalekold.net> writes:
I was trying some funky stuff with D, not real code just playing 
and I got a message of a seg fault and a core dump written to a 
log. I just wondered where these logs are written to. It's not 
immediately apparent where it is.
May 28 2013
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
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)
May 28 2013
next sibling parent "Gary Willoughby" <dev kalekold.net> writes:
On Tuesday, 28 May 2013 at 21:15:55 UTC, Adam D. Ruppe wrote:
 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)
Great thanks.
May 29 2013
prev sibling parent "Dicebot" <m.strashun gmail.com> writes:
On Tuesday, 28 May 2013 at 21:15:55 UTC, Adam D. Ruppe wrote:
 ...
Also worth noting that if your distro uses systemd, than core dumps by default are written to journal and managed via coredumpctl : http://www.freedesktop.org/software/systemd/man/systemd-coredumpctl.html
May 29 2013