You are not logged in.

#1 2014-12-29 01:24:16

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

[SOLVED] How to use coredumpctl?

I'm in general unfamiliar with coredumps. I accessed the target coredump via PID and got the following back:

     PID: 24032 (main)
           UID: 1000 ([left_out])
           GID: 100 (users)
        Signal: 11 (SEGV)
     Timestamp: Mon 2014-12-29 02:00:37 CET (17min ago)
  Command Line: ./main
    Executable: [left_out]
 Control Group: /user.slice/user-1000.slice/session-c1.scope
          Unit: session-c1.scope
         Slice: user-1000.slice
       Session: c1
     Owner UID: 1000 ([left_out])
       Boot ID: 7b20f50f580a4890bdbc56957aea0244
    Machine ID: b8227085e4fa442bb6dc7bc59554f127
      Hostname: [left_out]
      Coredump: /var/lib/systemd/coredump/core.main.1000.7b20f50f580a4890bdbc56957aea0244.24032.1419814837000000.lz4
       Message: Process 24032 (main) of user 1000 dumped core.
Refusing to dump core to tty.

First of all, isn't there supposed to be a line number indicating where the segfault happened? (I compiled with -g option).

Second of all. If I dump the above in a file an run

gdb my_binary coredump_file

It gives me back

coredump_file is not a core dump: File format not recognized

What am I doing wrong? How can I obtain the line number?

Last edited by mrgreen7 (2015-11-30 22:13:30)

Offline

#2 2014-12-29 12:47:45

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [SOLVED] How to use coredumpctl?

mrgreen7 wrote:

Second of all. If I dump the above in a file an run

Don't do that. Start gdb via coredumpctl directly, e.g.:

coredumpctl gdb 24032

Last edited by Morn (2014-12-29 12:53:43)

Offline

#3 2014-12-30 06:54:45

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

Re: [SOLVED] How to use coredumpctl?

This is working. Thank you for the hint.

However it would be helpful for me to know the "non-arch" way without coredumpctl. Is there a way to extract a file from coredumpctl which I in a second step can then pass on to gdb without coredumpctl being involved?

Offline

#4 2014-12-30 12:06:24

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [SOLVED] How to use coredumpctl?

from https://wiki.archlinux.org/index.php/Core_dump:

"systemd's default behavior is to generate core dumps for all processes in /var/lib/systemd/coredump."

So just navigating there and running gdb should work I think. Also, you can manually delete some dumps if they hog too much hard drive space. Systemd loves taking lots of space for its journals, dumps, etc.

Offline

#5 2015-01-04 20:48:34

mrgreen7
Member
Registered: 2014-12-21
Posts: 13

Re: [SOLVED] How to use coredumpctl?

The directory you mentioned contains .lz4 files. It looks like these are compressed coredumps. However I seem to be unable to decompress them. Using

lz4cat [file]

or

lz4 -d [file]

throws an error:

Error 44 : Unrecognized header : file cannot be decoded.

.

Last edited by mrgreen7 (2015-01-04 20:49:12)

Offline

#6 2015-01-04 21:59:29

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] How to use coredumpctl?

Yup,  you need to use 'coredumpctl dump' to decompress the core dumps.

There's an upstream task about this: https://bugs.freedesktop.org/show_bug.cgi?id=83266

Last edited by foutrelis (2015-01-04 21:59:56)

Offline

Board footer

Powered by FluxBB