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 --image-policy=policy
158 Takes an image policy string as argument, as per systemd.image-
159 policy(7). The policy is enforced when operating on the disk image
160 specified via --image=, see above. If not specified defaults to the
161 "*" policy, i.e. all recognized file systems in the image are used.
162
163 -q, --quiet
164 Suppresses informational messages about lack of access to journal
165 files and possible in-flight coredumps.
166
167 --all
168 Look at all available journal files in /var/log/journal/ (excluding
169 journal namespaces) instead of only local ones.
170
172 A match can be:
173
174 PID
175 Process ID of the process that dumped core. An integer.
176
177 COMM
178 Name of the executable (matches COREDUMP_COMM=). Must not contain
179 slashes.
180
181 EXE
182 Path to the executable (matches COREDUMP_EXE=). Must contain at
183 least one slash.
184
185 MATCH
186 General journalctl match filter, must contain an equals sign ("=").
187 See journalctl(1).
188
190 On success, 0 is returned; otherwise, a non-zero failure code is
191 returned. Not finding any matching core dumps is treated as failure.
192
194 $SYSTEMD_DEBUGGER
195 Use the given debugger for the debug command. See the --debugger=
196 option.
197
199 Example 1. List all the core dumps of a program
200
201 $ coredumpctl list /usr/lib64/firefox/firefox
202 TIME PID UID GID SIG COREFILE EXE SIZE
203 Tue ... 8018 1000 1000 SIGSEGV missing /usr/lib64/firefox/firefox -
204 Wed ... 251609 1000 1000 SIGTRAP missing /usr/lib64/firefox/firefox -
205 Fri ... 552351 1000 1000 SIGSEGV present /usr/lib64/firefox/firefox 28.7M
206
207 The journal has three entries pertaining to /usr/lib64/firefox/firefox,
208 and only the last entry still has an available core file (in external
209 storage on disk).
210
211 Note that coredumpctl needs access to the journal files to retrieve the
212 relevant entries from the journal. Thus, an unprivileged user will
213 normally only see information about crashing programs of this user.
214
215 Example 2. Invoke gdb on the last core dump
216
217 $ coredumpctl debug
218
219 Example 3. Use gdb to display full register info from the last core
220 dump
221
222 $ coredumpctl debug --debugger-arguments="-batch -ex 'info all-registers'"
223
224 Example 4. Show information about a core dump matched by PID
225
226 $ coredumpctl info 6654
227 PID: 6654 (bash)
228 UID: 1000 (user)
229 GID: 1000 (user)
230 Signal: 11 (SEGV)
231 Timestamp: Mon 2021-01-01 00:00:01 CET (20s ago)
232 Command Line: bash -c $'kill -SEGV $$'
233 Executable: /usr/bin/bash
234 Control Group: /user.slice/user-1000.slice/...
235 Unit: user@1000.service
236 User Unit: vte-spawn-....scope
237 Slice: user-1000.slice
238 Owner UID: 1000 (user)
239 Boot ID: ...
240 Machine ID: ...
241 Hostname: ...
242 Storage: /var/lib/systemd/coredump/core.bash.1000.....zst (present)
243 Size on Disk: 51.7K
244 Message: Process 130414 (bash) of user 1000 dumped core.
245
246 Stack trace of thread 130414:
247 #0 0x00007f398142358b kill (libc.so.6 + 0x3d58b)
248 #1 0x0000558c2c7fda09 kill_builtin (bash + 0xb1a09)
249 #2 0x0000558c2c79dc59 execute_builtin.lto_priv.0 (bash + 0x51c59)
250 #3 0x0000558c2c79709c execute_simple_command (bash + 0x4b09c)
251 #4 0x0000558c2c798408 execute_command_internal (bash + 0x4c408)
252 #5 0x0000558c2c7f6bdc parse_and_execute (bash + 0xaabdc)
253 #6 0x0000558c2c85415c run_one_command.isra.0 (bash + 0x10815c)
254 #7 0x0000558c2c77d040 main (bash + 0x31040)
255 #8 0x00007f398140db75 __libc_start_main (libc.so.6 + 0x27b75)
256 #9 0x0000558c2c77dd1e _start (bash + 0x31d1e)
257
258 Example 5. Extract the last core dump of /usr/bin/bar to a file named
259 bar.coredump
260
261 $ coredumpctl -o bar.coredump dump /usr/bin/bar
262
264 systemd-coredump(8), coredump.conf(5), systemd-journald.service(8),
265 gdb(1)
266
268 1. Discoverable Partitions Specification
269 https://uapi-group.org/specifications/specs/discoverable_partitions_specification
270
271
272
273systemd 254 COREDUMPCTL(1)