xref: /netbsd/usr.sbin/crash/crash.8 (revision a0cbda20)
1.\"	$NetBSD: crash.8,v 1.8 2019/03/23 02:07:32 mrg Exp $
2.\"
3.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Andrew Doran.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd March 22, 2019
31.Dt CRASH 8
32.Os
33.Sh NAME
34.Nm crash
35.Nd examine and debug system images
36.Sh SYNOPSIS
37.Nm
38.Op Fl w
39.Op Fl M Ar core
40.Op Fl N Ar kernel
41.Sh DESCRIPTION
42The
43.Nm
44command is used to examine and debug system images.
45.Pp
46If run without any arguments,
47.Nm
48operates on the running system.
49.Pp
50The options are as follows:
51.Bl -tag -width xpalidocious
52.It Fl M Ar core
53Operate on the specified crash dump instead of the default
54.Pa /dev/mem .
55Crash dumps should be from the same version of the system and same machine
56architecture as the running version of
57.Nm crash ,
58and must be uncompressed.
59.It Fl N Ar kernel
60Extract the name list from the specified kernel instead of the default
61.Pa /dev/ksyms .
62.It Fl w
63Enable writing.
64.El
65.Pp
66The command syntax used by
67.Nm
68is the same as the in-kernel debugger.
69See the
70.Xr ddb 4
71manual page for more information.
72.Pp
73Operations and facilities that require a running system, such as breakpoints,
74are not supported by
75.Nm crash .
76.Pp
77.Nm
78does not provide pagination.
79However, by using the pipe symbol, output may be sent to commands available
80from the shell.
81For example:
82.Bd -literal -offset abcd
83crash> ps | more
84crash> ps | grep ioflush
85.Ed
86.Sh EXAMPLES
87You can obtain a full list of all kernel stack traces with a shell pipeline
88like the following:
89.Bd -literal -offset abcd
90# echo ps | crash | grep '^[0-9]' | cut -c 30-46 | \\
91  sed 's,^,bt/a ,' | crash
92.Ed
93.Sh SEE ALSO
94.Xr ps 1 ,
95.Xr vmstat 1 ,
96.Xr ddb 4 ,
97.Xr pstat 8
98.Sh HISTORY
99The
100.Nm
101command appeared in
102.Nx 6.0 .
103.Sh BUGS
104The
105.Nm
106command for the sparc port is unstable.
107