Debian Codegraph @

upstream/debian-unstable/man1/coredumpctl.1

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