1 '\"
2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
4 .\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
5 .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
6 .\" Copyright 2021 Oxide Computer Company
7 .\" Copyright 1989 AT&T
8 .\"
9 .\" The contents of this file are subject to the terms of the
10 .\" Common Development and Distribution License (the "License").
11 .\" You may not use this file except in compliance with the License.
12 .\"
13 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14 .\" or http://www.opensolaris.org/os/licensing.
15 .\" See the License for the specific language governing permissions
16 .\" and limitations under the License.
17 .\"
18 .\" When distributing Covered Code, include this CDDL HEADER in each
19 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20 .\" If applicable, add the following below this CDDL HEADER, with the
21 .\" fields enclosed by brackets "[]" replaced with your own identifying
22 .\" information: Portions Copyright [yyyy] [name of copyright owner]
23 .\"
24 .Dd August 3, 2021
25 .Dt CORE 5
26 .Os
27 .Sh NAME
28 .Nm core
29 .Nd process core file
30 .Sh DESCRIPTION
31 The operating system writes out a core file for a process when the process is
32 terminated due to receiving certain signals.
33 A core file is a disk copy of the contents of the process address space at the
34 time the process received the signal, along with additional information about
35 the state of the process.
36 This information can be consumed by a debugger.
37 Core files can also be generated by applying the
38 .Xr gcore 1
39 utility to a running process.
40 .Pp
41 Typically, core files are produced following abnormal termination of a process
42 resulting from a bug in the corresponding application.
43 Whatever the cause, the core file itself provides invaluable information to the
44 programmer or support engineer to aid in diagnosing the problem.
176 field will have the
177 .Dv PF_SUNW_KILLED
178 flag set.
179 .Pp
180 The program headers of an
181 .Sy ELF
182 core file also contain entries for two
183 .Sy NOTE
184 segments, each containing several note entries as described below.
185 The note entry header and core file note type
186 .Pq Fa n_type
187 definitions are contained in
188 .In sys/elf.h .
189 The first
190 .Sy NOTE
191 segment exists for binary compatibility with old programs that deal with core
192 files.
193 It contains structures defined in
194 .In sys/old_procfs.h .
195 New programs should recognize and skip this
196 .Sy BNOTE
197 segment, advancing instead to the new
198 .Sy NOTE
199 segment.
200 The old
201 .Sy NOTE
202 segment is deleted from core files in a future release.
203 .Pp
204 The old
205 .Sy NOTE
206 segment contains the following entries.
207 Each has entry name
208 .Sy "CORE"
209 and presents the contents of a system structure:
210 .Bl -tag -width prpsinfo_t
211 .It Vt prpsinfo_t
212 .Fa n_type :
213 .Dv NT_PRPSINFO .
214 This entry contains information of interest to the
215 .Xr ps 1
216 command, such as process status, CPU usage, nice value, controlling terminal,
244 in the process, the old
245 .Sy NOTE
246 segment contains an entry with a
247 .Vt prstatus_t
248 structure, plus other optionally-present entries describing the LWP, as follows:
249 .Bl -tag -width "prfpregset_t"
250 .It Vt prstatus_t
251 .Fa n_type :
252 .Dv NT_PRSTATUS .
253 This structure contains things of interest to a debugger from the operating
254 system, such as the general registers, signal dispositions, state, reason for
255 stopping, process-ID, and so forth.
256 The
257 .Vt prstatus_t
258 structure is defined in
259 .In sys/old_procfs.h .
260 .It Vt prfpregset_t
261 .Fa n_type :
262 .Dv NT_PRFPREG .
263 This entry is present only if the
264 .Sy BLWP
265 used the floating-point hardware.
266 It contains the floating-point registers.
267 The
268 .Vt prfpregset_t
269 structure is defined in
270 .In sys/procfs_isa.h .
271 .It Vt gwindows_t
272 .Fa n_type :
273 .Dv NT_GWINDOWS .
274 This entry is present only on a SPARC machine and only if the system was unable
275 to flush all of the register windows to the stack.
276 It contains all of the unspilled register windows.
277 The
278 .Vt gwindows_t
279 structure is defined in
280 .In sys/regset.h .
281 .It Vt prxregset_t
282 .Fa n_type :
283 .Dv NT_PRXREG .
284 This entry is present only if the machine has extra register state associated
285 with it.
286 It contains the extra register state.
287 The
288 .Vt prxregset_t
289 structure is defined in
290 .Vt sys/procfs_isa.h .
291 .El
292 .Pp
293 The new
294 .Sy NOTE
295 segment contains the following entries.
296 Each has entry name
297 .Sy "CORE"
298 and presents the contents of a system structure:
299 .Bl -tag -width prxregset_t
300 .It Vt psinfo_t
301 .Fa n_type :
302 .Dv NT_PSINFO .
303 This structure contains information of interest to the
304 .Xr ps 1
305 command, such as process status, CPU usage, nice value, controlling terminal,
306 user-ID, process-ID, the name of the executable, and so forth.
307 The
308 .Vt psinfo_t
309 structure is defined in
310 .In sys/procfs.h
504 .In sys/procfs.h .
505 .Vt gwindows_t
506 .Fa n_type :
507 .Dv NT_GWINDOWS .
508 This entry is present only on a SPARC machine and only if the system was unable
509 to flush all of the register windows to the stack.
510 It contains all of the unspilled register windows.
511 The
512 .Vt gwindows_t
513 structure is defined in
514 .In sys/regset.h .
515 .It Vt prxregset_t
516 .Fa n_type :
517 .Dv NT_PRXREG .
518 This entry is present only if the machine has extra register state associated
519 with it.
520 It contains the extra register state.
521 The
522 .Vt prxregset_t
523 structure is defined in
524 .In sys/procfs_isa.h .
525 .It Vt asrset_t
526 \fB\fBasrset_t\fR\fR
527 .Fa n_type :
528 .Dv NT_ASRS .
529 This entry is present only on a SPARC V9 machine and only if the process is a
530 64-bit process.
531 It contains the ancillary state registers for the LWP.
532 The
533 .Vt asrset_t asrset_t
534 structure is defined in
535 .In sys/regset.h .
536 .It Vt psinfo_t
537 .Fa n_type :
538 .Dv NT_SPYMASTER .
539 This entry is present only for an agent LWP and contains the
540 .Vt psinfo_t
541 of the process that created the agent LWP.
542 See the
543 .Xr proc 5
544 description of the
|
1 '\"
2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
4 .\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
5 .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
6 .\" Copyright 2023 Oxide Computer Company
7 .\" Copyright 1989 AT&T
8 .\"
9 .\" The contents of this file are subject to the terms of the
10 .\" Common Development and Distribution License (the "License").
11 .\" You may not use this file except in compliance with the License.
12 .\"
13 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14 .\" or http://www.opensolaris.org/os/licensing.
15 .\" See the License for the specific language governing permissions
16 .\" and limitations under the License.
17 .\"
18 .\" When distributing Covered Code, include this CDDL HEADER in each
19 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20 .\" If applicable, add the following below this CDDL HEADER, with the
21 .\" fields enclosed by brackets "[]" replaced with your own identifying
22 .\" information: Portions Copyright [yyyy] [name of copyright owner]
23 .\"
24 .Dd January 24, 2023
25 .Dt CORE 5
26 .Os
27 .Sh NAME
28 .Nm core
29 .Nd process core file
30 .Sh DESCRIPTION
31 The operating system writes out a core file for a process when the process is
32 terminated due to receiving certain signals.
33 A core file is a disk copy of the contents of the process address space at the
34 time the process received the signal, along with additional information about
35 the state of the process.
36 This information can be consumed by a debugger.
37 Core files can also be generated by applying the
38 .Xr gcore 1
39 utility to a running process.
40 .Pp
41 Typically, core files are produced following abnormal termination of a process
42 resulting from a bug in the corresponding application.
43 Whatever the cause, the core file itself provides invaluable information to the
44 programmer or support engineer to aid in diagnosing the problem.
176 field will have the
177 .Dv PF_SUNW_KILLED
178 flag set.
179 .Pp
180 The program headers of an
181 .Sy ELF
182 core file also contain entries for two
183 .Sy NOTE
184 segments, each containing several note entries as described below.
185 The note entry header and core file note type
186 .Pq Fa n_type
187 definitions are contained in
188 .In sys/elf.h .
189 The first
190 .Sy NOTE
191 segment exists for binary compatibility with old programs that deal with core
192 files.
193 It contains structures defined in
194 .In sys/old_procfs.h .
195 New programs should recognize and skip this
196 .Sy NOTE
197 segment, advancing instead to the new
198 .Sy NOTE
199 segment.
200 The old
201 .Sy NOTE
202 segment is deleted from core files in a future release.
203 .Pp
204 The old
205 .Sy NOTE
206 segment contains the following entries.
207 Each has entry name
208 .Sy "CORE"
209 and presents the contents of a system structure:
210 .Bl -tag -width prpsinfo_t
211 .It Vt prpsinfo_t
212 .Fa n_type :
213 .Dv NT_PRPSINFO .
214 This entry contains information of interest to the
215 .Xr ps 1
216 command, such as process status, CPU usage, nice value, controlling terminal,
244 in the process, the old
245 .Sy NOTE
246 segment contains an entry with a
247 .Vt prstatus_t
248 structure, plus other optionally-present entries describing the LWP, as follows:
249 .Bl -tag -width "prfpregset_t"
250 .It Vt prstatus_t
251 .Fa n_type :
252 .Dv NT_PRSTATUS .
253 This structure contains things of interest to a debugger from the operating
254 system, such as the general registers, signal dispositions, state, reason for
255 stopping, process-ID, and so forth.
256 The
257 .Vt prstatus_t
258 structure is defined in
259 .In sys/old_procfs.h .
260 .It Vt prfpregset_t
261 .Fa n_type :
262 .Dv NT_PRFPREG .
263 This entry is present only if the
264 .Sy LWP
265 used the floating-point hardware.
266 It contains the floating-point registers.
267 The
268 .Vt prfpregset_t
269 structure is defined in
270 .In sys/procfs_isa.h .
271 .It Vt gwindows_t
272 .Fa n_type :
273 .Dv NT_GWINDOWS .
274 This entry is present only on a SPARC machine and only if the system was unable
275 to flush all of the register windows to the stack.
276 It contains all of the unspilled register windows.
277 The
278 .Vt gwindows_t
279 structure is defined in
280 .In sys/regset.h .
281 .It Vt prxregset_t
282 .Fa n_type :
283 .Dv NT_PRXREG .
284 This entry is no longer included in core files, but is of historical note
285 because in the past it was included on SPARC-based systems.
286 While since then the
287 .Vt prxregset_t
288 and extended register sets have been defined on other architectures, they do not
289 emit this in the old note section because there is no binary compatibility.
290 .El
291 .Pp
292 The new
293 .Sy NOTE
294 segment contains the following entries.
295 Each has entry name
296 .Sy "CORE"
297 and presents the contents of a system structure:
298 .Bl -tag -width prxregset_t
299 .It Vt psinfo_t
300 .Fa n_type :
301 .Dv NT_PSINFO .
302 This structure contains information of interest to the
303 .Xr ps 1
304 command, such as process status, CPU usage, nice value, controlling terminal,
305 user-ID, process-ID, the name of the executable, and so forth.
306 The
307 .Vt psinfo_t
308 structure is defined in
309 .In sys/procfs.h
503 .In sys/procfs.h .
504 .Vt gwindows_t
505 .Fa n_type :
506 .Dv NT_GWINDOWS .
507 This entry is present only on a SPARC machine and only if the system was unable
508 to flush all of the register windows to the stack.
509 It contains all of the unspilled register windows.
510 The
511 .Vt gwindows_t
512 structure is defined in
513 .In sys/regset.h .
514 .It Vt prxregset_t
515 .Fa n_type :
516 .Dv NT_PRXREG .
517 This entry is present only if the machine has extra register state associated
518 with it.
519 It contains the extra register state.
520 The
521 .Vt prxregset_t
522 structure is defined in
523 .In sys/procfs_isa.h ;
524 however applications should include
525 .In procfs.h
526 to get access to it.
527 On most architectures the
528 .Vt prxregset_t
529 is opaque and is made up of multiple structures because it can vary in length.
530 .Xr proc 5
531 discusses the structure of the extended register set for each supported
532 architecture.
533 .It Vt asrset_t
534 \fB\fBasrset_t\fR\fR
535 .Fa n_type :
536 .Dv NT_ASRS .
537 This entry is present only on a SPARC V9 machine and only if the process is a
538 64-bit process.
539 It contains the ancillary state registers for the LWP.
540 The
541 .Vt asrset_t asrset_t
542 structure is defined in
543 .In sys/regset.h .
544 .It Vt psinfo_t
545 .Fa n_type :
546 .Dv NT_SPYMASTER .
547 This entry is present only for an agent LWP and contains the
548 .Vt psinfo_t
549 of the process that created the agent LWP.
550 See the
551 .Xr proc 5
552 description of the
|