xref: /netbsd-src/usr.sbin/crash/crash.8 (revision 52a6ad3df5abf596fafbb6a3e377ce531341518b)
1*52a6ad3dSgutteridge.\"	$NetBSD: crash.8,v 1.9 2024/01/14 00:40:21 gutteridge Exp $
2101a9782Sad.\"
3101a9782Sad.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4101a9782Sad.\" All rights reserved.
5101a9782Sad.\"
6101a9782Sad.\" This code is derived from software contributed to The NetBSD Foundation
7101a9782Sad.\" by Andrew Doran.
8101a9782Sad.\"
9101a9782Sad.\" Redistribution and use in source and binary forms, with or without
10101a9782Sad.\" modification, are permitted provided that the following conditions
11101a9782Sad.\" are met:
12101a9782Sad.\" 1. Redistributions of source code must retain the above copyright
13101a9782Sad.\"    notice, this list of conditions and the following disclaimer.
14101a9782Sad.\" 2. Redistributions in binary form must reproduce the above copyright
15101a9782Sad.\"    notice, this list of conditions and the following disclaimer in the
16101a9782Sad.\"    documentation and/or other materials provided with the distribution.
17101a9782Sad.\"
18101a9782Sad.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19101a9782Sad.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20101a9782Sad.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21101a9782Sad.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22101a9782Sad.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23101a9782Sad.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24101a9782Sad.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25101a9782Sad.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26101a9782Sad.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27101a9782Sad.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28101a9782Sad.\" POSSIBILITY OF SUCH DAMAGE.
29101a9782Sad.\"
30*52a6ad3dSgutteridge.Dd January 14, 2024
31101a9782Sad.Dt CRASH 8
32101a9782Sad.Os
33101a9782Sad.Sh NAME
34101a9782Sad.Nm crash
35101a9782Sad.Nd examine and debug system images
36101a9782Sad.Sh SYNOPSIS
37101a9782Sad.Nm
3804f07660Swiz.Op Fl w
39101a9782Sad.Op Fl M Ar core
404516c056Spgoyette.Op Fl N Ar kernel
41101a9782Sad.Sh DESCRIPTION
42101a9782SadThe
43101a9782Sad.Nm
44101a9782Sadcommand is used to examine and debug system images.
45101a9782Sad.Pp
46101a9782SadIf run without any arguments,
47101a9782Sad.Nm
48101a9782Sadoperates on the running system.
49101a9782Sad.Pp
50101a9782SadThe options are as follows:
51101a9782Sad.Bl -tag -width xpalidocious
52101a9782Sad.It Fl M Ar core
53101a9782SadOperate on the specified crash dump instead of the default
54101a9782Sad.Pa /dev/mem .
55101a9782SadCrash dumps should be from the same version of the system and same machine
56101a9782Sadarchitecture as the running version of
57101a9782Sad.Nm crash ,
58101a9782Sadand must be uncompressed.
59101a9782Sad.It Fl N Ar kernel
60101a9782SadExtract the name list from the specified kernel instead of the default
61101a9782Sad.Pa /dev/ksyms .
62f7bf36a3Schristos.It Fl w
63f7bf36a3SchristosEnable writing.
64101a9782Sad.El
65101a9782Sad.Pp
66101a9782SadThe command syntax used by
67101a9782Sad.Nm
68101a9782Sadis the same as the in-kernel debugger.
69101a9782SadSee the
70101a9782Sad.Xr ddb 4
71101a9782Sadmanual page for more information.
72101a9782Sad.Pp
73101a9782SadOperations and facilities that require a running system, such as breakpoints,
74101a9782Sadare not supported by
75101a9782Sad.Nm crash .
76101a9782Sad.Pp
77101a9782Sad.Nm
78101a9782Saddoes not provide pagination.
79101a9782SadHowever, by using the pipe symbol, output may be sent to commands available
80101a9782Sadfrom the shell.
81101a9782SadFor example:
82101a9782Sad.Bd -literal -offset abcd
8301869ca4Swizcrash> ps | more
8401869ca4Swizcrash> ps | grep ioflush
85101a9782Sad.Ed
864f3dd60bSmrg.Sh EXAMPLES
874f3dd60bSmrgYou can obtain a full list of all kernel stack traces with a shell pipeline
884f3dd60bSmrglike the following:
894f3dd60bSmrg.Bd -literal -offset abcd
904f3dd60bSmrg# echo ps | crash | grep '^[0-9]' | cut -c 30-46 | \\
914f3dd60bSmrg  sed 's,^,bt/a ,' | crash
924f3dd60bSmrg.Ed
93101a9782Sad.Sh SEE ALSO
94101a9782Sad.Xr ps 1 ,
95101a9782Sad.Xr vmstat 1 ,
962f43aa5fSwiz.Xr ddb 4 ,
97*52a6ad3dSgutteridge.Xr pstat 8 ,
98*52a6ad3dSgutteridge.Xr savecore 8
99101a9782Sad.Sh HISTORY
100101a9782SadThe
101101a9782Sad.Nm
102101a9782Sadcommand appeared in
103101a9782Sad.Nx 6.0 .
1040ef38b00Smrg.Sh BUGS
1050ef38b00SmrgThe
1060ef38b00Smrg.Nm
1070ef38b00Smrgcommand for the sparc port is unstable.
108