Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 28, 2013 Where does the log get written when there's a core dump? | ||||
---|---|---|---|---|
| ||||
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 Re: Where does the log get written when there's a core dump? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | 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 29, 2013 Re: Where does the log get written when there's a core dump? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | 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 Re: Where does the log get written when there's a core dump? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | 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 |
Copyright © 1999-2021 by the D Language Foundation