1COREDUMPCTL(1) coredumpctl COREDUMPCTL(1)
2
3
4
6 coredumpctl - Retrieve and process saved core dumps and metadata
7
9 coredumpctl [OPTIONS...] {COMMAND} [PID|COMM|EXE|MATCH...]
10
12 coredumpctl is a tool that can be used to retrieve and process core
13 dumps and metadata which were saved by systemd-coredump(8).
14
16 The following commands are understood:
17
18 list
19 List core dumps captured in the journal matching specified
20 characteristics. If no command is specified, this is the implied
21 default.
22
23 The output is designed to be human readable and contains a table
24 with the following columns:
25
26 TIME
27 The timestamp of the crash, as reported by the kernel.
28
29 PID
30 The identifier of the process that crashed.
31
32 UID, GID
33 The user and group identifiers of the process that crashed.
34
35 SIGNAL
36 The signal that caused the process to crash, when applicable.
37
38 COREFILE
39 Information whether the coredump was stored, and whether it is
40 still accessible: "none" means the core was not stored, "-"
41 means that it was not available (for example because the
42 process was not terminated by a signal), "present" means that
43 the core file is accessible by the current user, "journal"
44 means that the core was stored in the "journal", "truncated" is
45 the same as one of the previous two, but the core was too large
46 and was not stored in its entirety, "error" means that the core
47 file cannot be accessed, most likely because of insufficient
48 permissions, and "missing" means that the core was stored in a
49 file, but this file has since been removed.
50
51 EXE
52 The full path to the executable. For backtraces of scripts this
53 is the name of the interpreter.
54
55 It's worth noting that different restrictions apply to data saved
56 in the journal and core dump files saved in
57 /var/lib/systemd/coredump, see overview in systemd-coredump(8).
58 Thus it may very well happen that a particular core dump is still
59 listed in the journal while its corresponding core dump file has
60 already been removed.
61
62 info
63 Show detailed information about the last core dump or core dumps
64 matching specified characteristics captured in the journal.
65
66 dump
67 Extract the last core dump matching specified characteristics. The
68 core dump will be written on standard output, unless an output file
69 is specified with --output=.
70
71 debug
72 Invoke a debugger on the last core dump matching specified
73 characteristics. By default, gdb(1) will be used. This may be
74 changed using the --debugger= option or the $SYSTEMD_DEBUGGER
75 environment variable. Use the --debugger-arguments= option to pass
76 extra command line arguments to the debugger.
77
79 The following options are understood:
80
81 -h, --help
82 Print a short help text and exit.
83
84 --version
85 Print a short version string and exit.
86
87 --no-pager
88 Do not pipe output into a pager.
89
90 --no-legend
91 Do not print the legend, i.e. column headers and the footer with
92 hints.
93
94 --json=MODE
95 Shows output formatted as JSON. Expects one of "short" (for the
96 shortest possible output without any redundant whitespace or line
97 breaks), "pretty" (for a pretty version of the same, with
98 indentation and line breaks) or "off" (to turn off JSON output, the
99 default).
100
101 -1
102 Show information of the most recent core dump only, instead of
103 listing all known core dumps. Equivalent to --reverse -n 1.
104
105 -n INT
106 Show at most the specified number of entries. The specified
107 parameter must be an integer greater or equal to 1.
108
109 -S, --since
110 Only print entries which are since the specified date.
111
112 -U, --until
113 Only print entries which are until the specified date.
114
115 -r, --reverse
116 Reverse output so that the newest entries are displayed first.
117
118 -F FIELD, --field=FIELD
119 Print all possible data values the specified field takes in
120 matching core dump entries of the journal.
121
122 -o FILE, --output=FILE
123 Write the core to FILE.
124
125 --debugger=DEBUGGER
126 Use the given debugger for the debug command. If not given and
127 $SYSTEMD_DEBUGGER is unset, then gdb(1) will be used.
128
129 -A ARGS, --debugger-arguments=ARGS
130 Pass the given ARGS as extra command line arguments to the
131 debugger. Quote as appropriate when ARGS contain whitespace. (See
132 Examples.)
133
134 --file=GLOB
135 Takes a file glob as an argument. If specified, coredumpctl will
136 operate on the specified journal files matching GLOB instead of the
137 default runtime and system journal paths. May be specified multiple
138 times, in which case files will be suitably interleaved.
139
140 -D DIR, --directory=DIR
141 Use the journal files in the specified DIR.
142
143 --root=ROOT
144 Use root directory ROOT when searching for coredumps.
145
146 --image=image
147 Takes a path to a disk image file or block device node. If
148 specified, all operations are applied to file system in the
149 indicated disk image. This option is similar to --root=, but
150 operates on file systems stored in disk images or block devices.
151 The disk image should either contain just a file system or a set of
152 file systems within a GPT partition table, following the
153 Discoverable Partitions Specification[1]. For further information
154 on supported disk images, see systemd-nspawn(1)'s switch of the
155 same name.
156
157 -q, --quiet
158 Suppresses informational messages about lack of access to journal
159 files and possible in-flight coredumps.
160
161 --all
162 Look at all available journal files in /var/log/journal/ (excluding
163 journal namespaces) instead of only local ones.
164
166 A match can be:
167
168 PID
169 Process ID of the process that dumped core. An integer.
170
171 COMM
172 Name of the executable (matches COREDUMP_COMM=). Must not contain
173 slashes.
174
175 EXE
176 Path to the executable (matches COREDUMP_EXE=). Must contain at
177 least one slash.
178
179 MATCH
180 General journalctl match filter, must contain an equals sign ("=").
181 See journalctl(1).
182
184 On success, 0 is returned; otherwise, a non-zero failure code is
185 returned. Not finding any matching core dumps is treated as failure.
186
188 $SYSTEMD_DEBUGGER
189 Use the given debugger for the debug command. See the --debugger=
190 option.
191
193 Example 1. List all the core dumps of a program
194
195 $ coredumpctl list /usr/lib64/firefox/firefox
196 TIME PID UID GID SIG COREFILE EXE SIZE
197 Tue ... 8018 1000 1000 SIGSEGV missing /usr/lib64/firefox/firefox -
198 Wed ... 251609 1000 1000 SIGTRAP missing /usr/lib64/firefox/firefox -
199 Fri ... 552351 1000 1000 SIGSEGV present /usr/lib64/firefox/firefox 28.7M
200
201 The journal has three entries pertaining to /usr/lib64/firefox/firefox,
202 and only the last entry still has an available core file (in external
203 storage on disk).
204
205 Note that coredumpctl needs access to the journal files to retrieve the
206 relevant entries from the journal. Thus, an unprivileged user will
207 normally only see information about crashing programs of this user.
208
209 Example 2. Invoke gdb on the last core dump
210
211 $ coredumpctl debug
212
213 Example 3. Use gdb to display full register info from the last core
214 dump
215
216 $ coredumpctl debug --debugger-arguments="-batch -ex 'info all-registers'"
217
218 Example 4. Show information about a core dump matched by PID
219
220 $ coredumpctl info 6654
221 PID: 6654 (bash)
222 UID: 1000 (user)
223 GID: 1000 (user)
224 Signal: 11 (SEGV)
225 Timestamp: Mon 2021-01-01 00:00:01 CET (20s ago)
226 Command Line: bash -c $'kill -SEGV $$'
227 Executable: /usr/bin/bash
228 Control Group: /user.slice/user-1000.slice/...
229 Unit: user@1000.service
230 User Unit: vte-spawn-....scope
231 Slice: user-1000.slice
232 Owner UID: 1000 (user)
233 Boot ID: ...
234 Machine ID: ...
235 Hostname: ...
236 Storage: /var/lib/systemd/coredump/core.bash.1000.....zst (present)
237 Size on Disk: 51.7K
238 Message: Process 130414 (bash) of user 1000 dumped core.
239
240 Stack trace of thread 130414:
241 #0 0x00007f398142358b kill (libc.so.6 + 0x3d58b)
242 #1 0x0000558c2c7fda09 kill_builtin (bash + 0xb1a09)
243 #2 0x0000558c2c79dc59 execute_builtin.lto_priv.0 (bash + 0x51c59)
244 #3 0x0000558c2c79709c execute_simple_command (bash + 0x4b09c)
245 #4 0x0000558c2c798408 execute_command_internal (bash + 0x4c408)
246 #5 0x0000558c2c7f6bdc parse_and_execute (bash + 0xaabdc)
247 #6 0x0000558c2c85415c run_one_command.isra.0 (bash + 0x10815c)
248 #7 0x0000558c2c77d040 main (bash + 0x31040)
249 #8 0x00007f398140db75 __libc_start_main (libc.so.6 + 0x27b75)
250 #9 0x0000558c2c77dd1e _start (bash + 0x31d1e)
251
252 Example 5. Extract the last core dump of /usr/bin/bar to a file named
253 bar.coredump
254
255 $ coredumpctl -o bar.coredump dump /usr/bin/bar
256
258 systemd-coredump(8), coredump.conf(5), systemd-journald.service(8),
259 gdb(1)
260
262 1. Discoverable Partitions Specification
263 https://uapi-group.org/specifications/specs/discoverable_partitions_specification
264
265
266
267systemd 253 COREDUMPCTL(1)