1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
'\" t
.TH "COREDUMPCTL" "1" "" "systemd 254" "coredumpctl"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
coredumpctl \- Retrieve and process saved core dumps and metadata
.SH "SYNOPSIS"
.HP \w'\fBcoredumpctl\fR\ 'u
\fBcoredumpctl\fR [OPTIONS...] {COMMAND} [PID|COMM|EXE|MATCH...]
.SH "DESCRIPTION"
.PP
\fBcoredumpctl\fR
is a tool that can be used to retrieve and process core dumps and metadata which were saved by
\fBsystemd-coredump\fR(8)\&.
.SH "COMMANDS"
.PP
The following commands are understood:
.PP
\fBlist\fR
.RS 4
List core dumps captured in the journal matching specified characteristics\&. If no command is specified, this is the implied default\&.
.sp
The output is designed to be human readable and contains a table with the following columns:
.PP
TIME
.RS 4
The timestamp of the crash, as reported by the kernel\&.
.RE
.PP
PID
.RS 4
The identifier of the process that crashed\&.
.RE
.PP
UID, GID
.RS 4
The user and group identifiers of the process that crashed\&.
.RE
.PP
SIGNAL
.RS 4
The signal that caused the process to crash, when applicable\&.
.RE
.PP
COREFILE
.RS 4
Information whether the coredump was stored, and whether it is still accessible:
"none"
means the core was not stored,
"\-"
means that it was not available (for example because the process was not terminated by a signal),
"present"
means that the core file is accessible by the current user,
"journal"
means that the core was stored in the
"journal",
"truncated"
is the same as one of the previous two, but the core was too large and was not stored in its entirety,
"error"
means that the core file cannot be accessed, most likely because of insufficient permissions, and
"missing"
means that the core was stored in a file, but this file has since been removed\&.
.RE
.PP
EXE
.RS 4
The full path to the executable\&. For backtraces of scripts this is the name of the interpreter\&.
.RE
.sp
It\*(Aqs worth noting that different restrictions apply to data saved in the journal and core dump files saved in
/var/lib/systemd/coredump, see overview in
\fBsystemd-coredump\fR(8)\&. Thus it may very well happen that a particular core dump is still listed in the journal while its corresponding core dump file has already been removed\&.
.RE
.PP
\fBinfo\fR
.RS 4
Show detailed information about the last core dump or core dumps matching specified characteristics captured in the journal\&.
.RE
.PP
\fBdump\fR
.RS 4
Extract the last core dump matching specified characteristics\&. The core dump will be written on standard output, unless an output file is specified with
\fB\-\-output=\fR\&.
.RE
.PP
\fBdebug\fR
.RS 4
Invoke a debugger on the last core dump matching specified characteristics\&. By default,
\fBgdb\fR(1)
will be used\&. This may be changed using the
\fB\-\-debugger=\fR
option or the
\fI$SYSTEMD_DEBUGGER\fR
environment variable\&. Use the
\fB\-\-debugger\-arguments=\fR
option to pass extra command line arguments to the debugger\&.
.RE
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.PP
\fB\-\-no\-pager\fR
.RS 4
Do not pipe output into a pager\&.
.RE
.PP
\fB\-\-no\-legend\fR
.RS 4
Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
.RE
.PP
\fB\-\-json=\fR\fIMODE\fR
.RS 4
Shows output formatted as JSON\&. Expects one of
"short"
(for the shortest possible output without any redundant whitespace or line breaks),
"pretty"
(for a pretty version of the same, with indentation and line breaks) or
"off"
(to turn off JSON output, the default)\&.
.RE
.PP
\fB\-1\fR
.RS 4
Show information of the most recent core dump only, instead of listing all known core dumps\&. Equivalent to
\fB\-\-reverse \-n 1\fR\&.
.RE
.PP
\fB\-n\fR \fIINT\fR
.RS 4
Show at most the specified number of entries\&. The specified parameter must be an integer greater or equal to 1\&.
.RE
.PP
\fB\-S\fR, \fB\-\-since\fR
.RS 4
Only print entries which are since the specified date\&.
.RE
.PP
\fB\-U\fR, \fB\-\-until\fR
.RS 4
Only print entries which are until the specified date\&.
.RE
.PP
\fB\-r\fR, \fB\-\-reverse\fR
.RS 4
Reverse output so that the newest entries are displayed first\&.
.RE
.PP
\fB\-F\fR \fIFIELD\fR, \fB\-\-field=\fR\fIFIELD\fR
.RS 4
Print all possible data values the specified field takes in matching core dump entries of the journal\&.
.RE
.PP
\fB\-o\fR \fIFILE\fR, \fB\-\-output=\fR\fIFILE\fR
.RS 4
Write the core to
\fBFILE\fR\&.
.RE
.PP
\fB\-\-debugger=\fR\fIDEBUGGER\fR
.RS 4
Use the given debugger for the
\fBdebug\fR
command\&. If not given and
\fI$SYSTEMD_DEBUGGER\fR
is unset, then
\fBgdb\fR(1)
will be used\&.
.RE
.PP
\fB\-A\fR \fIARGS\fR, \fB\-\-debugger\-arguments=\fR\fIARGS\fR
.RS 4
Pass the given
\fIARGS\fR
as extra command line arguments to the debugger\&. Quote as appropriate when
\fIARGS\fR
contain whitespace\&. (See Examples\&.)
.RE
.PP
\fB\-\-file=\fR\fB\fIGLOB\fR\fR
.RS 4
Takes a file glob as an argument\&. If specified, coredumpctl will operate on the specified journal files matching
\fIGLOB\fR
instead of the default runtime and system journal paths\&. May be specified multiple times, in which case files will be suitably interleaved\&.
.RE
.PP
\fB\-D\fR \fIDIR\fR, \fB\-\-directory=\fR\fIDIR\fR
.RS 4
Use the journal files in the specified
\fBDIR\fR\&.
.RE
.PP
\fB\-\-root=\fR\fB\fIROOT\fR\fR
.RS 4
Use root directory
\fBROOT\fR
when searching for coredumps\&.
.RE
.PP
\fB\-\-image=\fR\fB\fIimage\fR\fR
.RS 4
Takes a path to a disk image file or block device node\&. If specified, all operations are applied to file system in the indicated disk image\&. This option is similar to
\fB\-\-root=\fR, but operates on file systems stored in disk images or block devices\&. The disk image should either contain just a file system or a set of file systems within a GPT partition table, following the
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. For further information on supported disk images, see
\fBsystemd-nspawn\fR(1)\*(Aqs switch of the same name\&.
.RE
.PP
\fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
.RS 4
Takes an image policy string as argument, as per
\fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
\fB\-\-image=\fR, see above\&. If not specified defaults to the
"*"
policy, i\&.e\&. all recognized file systems in the image are used\&.
.RE
.PP
\fB\-q\fR, \fB\-\-quiet\fR
.RS 4
Suppresses informational messages about lack of access to journal files and possible in\-flight coredumps\&.
.RE
.PP
\fB\-\-all\fR
.RS 4
Look at all available journal files in
/var/log/journal/
(excluding journal namespaces) instead of only local ones\&.
.RE
.SH "MATCHING"
.PP
A match can be:
.PP
\fIPID\fR
.RS 4
Process ID of the process that dumped core\&. An integer\&.
.RE
.PP
\fICOMM\fR
.RS 4
Name of the executable (matches
\fBCOREDUMP_COMM=\fR)\&. Must not contain slashes\&.
.RE
.PP
\fIEXE\fR
.RS 4
Path to the executable (matches
\fBCOREDUMP_EXE=\fR)\&. Must contain at least one slash\&.
.RE
.PP
\fIMATCH\fR
.RS 4
General journalctl match filter, must contain an equals sign ("=")\&. See
\fBjournalctl\fR(1)\&.
.RE
.SH "EXIT STATUS"
.PP
On success, 0 is returned; otherwise, a non\-zero failure code is returned\&. Not finding any matching core dumps is treated as failure\&.
.SH "ENVIRONMENT"
.PP
\fI$SYSTEMD_DEBUGGER\fR
.RS 4
Use the given debugger for the
\fBdebug\fR
command\&. See the
\fB\-\-debugger=\fR
option\&.
.RE
.SH "EXAMPLES"
.PP
\fBExample\ \&1.\ \&List all the core dumps of a program\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ coredumpctl list /usr/lib64/firefox/firefox
TIME PID UID GID SIG COREFILE EXE SIZE
Tue \&... 8018 1000 1000 SIGSEGV missing /usr/lib64/firefox/firefox \-
Wed \&... 251609 1000 1000 SIGTRAP missing /usr/lib64/firefox/firefox \-
Fri \&... 552351 1000 1000 SIGSEGV present /usr/lib64/firefox/firefox 28\&.7M
.fi
.if n \{\
.RE
.\}
.PP
The journal has three entries pertaining to
/usr/lib64/firefox/firefox, and only the last entry still has an available core file (in external storage on disk)\&.
.PP
Note that
coredumpctl
needs access to the journal files to retrieve the relevant entries from the journal\&. Thus, an unprivileged user will normally only see information about crashing programs of this user\&.
.PP
\fBExample\ \&2.\ \&Invoke gdb on the last core dump\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ coredumpctl debug
.fi
.if n \{\
.RE
.\}
.PP
\fBExample\ \&3.\ \&Use gdb to display full register info from the last core dump\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ coredumpctl debug \-\-debugger\-arguments="\-batch \-ex \*(Aqinfo all\-registers\*(Aq"
.fi
.if n \{\
.RE
.\}
.PP
\fBExample\ \&4.\ \&Show information about a core dump matched by PID\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ coredumpctl info 6654
PID: 6654 (bash)
UID: 1000 (user)
GID: 1000 (user)
Signal: 11 (SEGV)
Timestamp: Mon 2021\-01\-01 00:00:01 CET (20s ago)
Command Line: bash \-c $\*(Aqkill \-SEGV $$\*(Aq
Executable: /usr/bin/bash
Control Group: /user\&.slice/user\-1000\&.slice/\&...
Unit: user@1000\&.service
User Unit: vte\-spawn\-\&...\&.scope
Slice: user\-1000\&.slice
Owner UID: 1000 (user)
Boot ID: \&...
Machine ID: \&...
Hostname: \&...
Storage: /var/lib/systemd/coredump/core\&.bash\&.1000\&.\&...\&.zst (present)
Size on Disk: 51\&.7K
Message: Process 130414 (bash) of user 1000 dumped core\&.
Stack trace of thread 130414:
#0 0x00007f398142358b kill (libc\&.so\&.6 + 0x3d58b)
#1 0x0000558c2c7fda09 kill_builtin (bash + 0xb1a09)
#2 0x0000558c2c79dc59 execute_builtin\&.lto_priv\&.0 (bash + 0x51c59)
#3 0x0000558c2c79709c execute_simple_command (bash + 0x4b09c)
#4 0x0000558c2c798408 execute_command_internal (bash + 0x4c408)
#5 0x0000558c2c7f6bdc parse_and_execute (bash + 0xaabdc)
#6 0x0000558c2c85415c run_one_command\&.isra\&.0 (bash + 0x10815c)
#7 0x0000558c2c77d040 main (bash + 0x31040)
#8 0x00007f398140db75 __libc_start_main (libc\&.so\&.6 + 0x27b75)
#9 0x0000558c2c77dd1e _start (bash + 0x31d1e)
.fi
.if n \{\
.RE
.\}
.PP
\fBExample\ \&5.\ \&Extract the last core dump of /usr/bin/bar to a file named bar\&.coredump\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ coredumpctl \-o bar\&.coredump dump /usr/bin/bar
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\fBsystemd-coredump\fR(8),
\fBcoredump.conf\fR(5),
\fBsystemd-journald.service\fR(8),
\fBgdb\fR(1)
.SH "NOTES"
.IP " 1." 4
Discoverable Partitions Specification
.RS 4
\%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
.RE
|