crash
PURPOSE
Examines system images.
SYNOPSIS
crash [ system ]
DESCRIPTION
The crash command is an interactive utility for examining
an operating system image (a core image or the running
kernel). It has facilities for interpreting and format-
ting the various control structures in the system and
certain miscellaneous functions useful for examining a
dump.
The system parameter specifies the file that contains the
system image and the kernel symbol definitions. Its
default value is /dev/mem. Thus you can run crash with
no arguments to examine an active system. If you specify
a system-image file, crash assumes that it is a system
dump file, and it sets the default process to the process
running at the time of the crash.
Notes:
1. A source listing of the system header files may be
helpful while using crash to identify the flags it
uses.
2. Stack tracing of the current process on a running
system does not work.
The crash command recognizes several aliases in the
format specification accompanying the subcommands. They
are as follows:
Format Aliases Format Aliases
byte b inode ino, i
character char, c longdec ld, D
decimal dec, e longoct lo, O
directory direct, dir, d octal oct, o
hexadecimal hexadec, hex, h, x write w
SUBCOMMANDS
The crash command presents a prompt (">") when it is
ready to interpret subcommands entered at the work
station. The general subcommand format for crash is:
subcommand [flags] [structures to be displayed]
When allowed, flags modify the format of the data dis-
played. If you do not specify which structure elements
you want to examine, all valid entries are displayed. In
general, those subcommands that perform I/O with
addresses assume hexadecimal notation.
Most of the subcommands recognized by crash have aliases
(abbreviated forms that give the same result). crash
recognizes the following subcommands:
buf [buffer-header] . . .
Displays the system buffer headers.
buffer [format] [buffer] . . .
Displays the data in a system buffer according to
format. If you do not provide a format parameter,
the previous format is used. Valid formats include
decimal, octal, hex, character, byte, directory,
i-node and write. The write format creates a file
in the current directory containing the buffer data.
callout Aliases: calls,
call, c, timeout, time, tout
Displays all entries in the callout table.
cm [slot-number segment-number]
If you specify the process slot-number and segment
number, this subcommand changes the map of crash
internal pointers for any segment of a process not
swapped out. This allows the od subcommand to
display data relative to the beginning of the
segment desired. If you enter cm without any param-
eters, cm resets the map (equivalent of a reset sub-
command). Use only when analyzing the currently
running system.
ds [data-address] . . .
Finds the data symbols closest to the given
addresses.
du [slot-number]
Uses the specified process slot number to display a
combined hex and ASCII dump of the user block for
any process that has not been swapped out. The
default is the current process.
dvfs
Displays the dummy virtual file system structures
currently mounted on the system. This subcommand is
useful in a distributed services environment.
file [file-table-entry] . . . Aliases: files, f
Displays the file table. Unless specific file
entries are requested, only those with a nonzero
reference are displayed.
fs [slot-number]
Traces a kernel stack for the process specified by
the process slot number for any process that has not
been swapped out. Displays the called subroutines
with a hex dump of the stack frame for the subrou-
tine which contains the parameters passed to the
subroutine. The default process is the currently
running process.
inode [-] [i-node-table-entry] . . . Aliases: ino, i
Displays the i-node table. The - flag also displays
the i-node data block addresses. Unless specific
i-node entries are requested, only those with a
nonzero reference are displayed.
map [map-name] . . .
Displays the named system map structures.
mount [mount-table-entry] . . . Aliases: mnt, m
Displays the mount table. Unless specific mount
table entries are requested, only those in use are
displayed.
nm [symbol] . . .
Displays symbol value and type as found in the
kernel-image file.
od [symbol name or address] [count] [format]
Dumps count data values starting at the symbol value
or address given according to format. Allowable
formats are octal, longoct, decimal, longdec, char-
acter, hex or byte.
proc [-] [-r] [process-table-entry] . . . Aliases:
ps, p
Displays the process table. (See the
/usr/include/sys/proc.h file for this structure
definition.) The -r flag causes only runable proc-
esses to be displayed. The - (minus) alone displays
a longer listing.
q
Exits from crash.
reset Aliases: r
Reinitializes the crash data, takes another slice
from /dev/mem, and updates the process table. Any
new processes created can be displayed. Use only
when analysing the currently running system.
stack [process-table-entry] . . . Aliases: stk, s,
kernel, k
Displays a dump of the kernel stack of a process.
The addresses shown are virtual data addresses
rather than true physical locations. If you do not
specify an entry, information about the last running
process is displayed. You can not trace the stack
of the current process on a running system.
stat
Displays statistics found in the dump. These
include the panic message (if a panic occurred),
time of crash, and system name.
text [text-table-entry] . . . Aliases: txt, x
Displays the text table. Unless specific text
entries are requested, only those with a nonzero
i-node pointer are displayed.
trace [process-table-entry] . . . Aliases: t
Displays a kernel stack trace of the current
process. The trace starts at the bottom of the
stack and attempts to find valid stack frames deeper
in the stack. If you do not specify a process table
entry, information about the last running process is
displayed.
ts [text-address] . . .
Finds the text symbols closest to the given
addresses.
tty [type] [-] [tty-entry] . . . Aliases: term,
dz, dh
Displays the tty structures. The type parameter
specifies which structure is used (such as ksr, or
rs). The last type entered with the tty command
becomes the default. The - flag displays the stty
parameters for the given line.
user [process-table-entry] . . . Aliases: uarea,
u_area, u
Displays the user structure of the named process as
determined by the information contained in the
process table entry. (See the
/usr/include/sys/user.h file for this structure
definition.) If you do not specify the entry, the
information about the last running process is dis-
played. Attempting to display a paged process
produces an error message.
var Aliases:
tunables, tunable, tune, v
Displays the tunable system parameters.
vfs
Displays the virtual file systems currently mounted
on the system. This subcommand is useful in a dis-
tributed services environment.
vnode [slot-number]
Uses the speicfied process slot number to display an
entry in the v-node table. The defualt is to
display the entire v-node structure.
!
Runs shell commands.
?
Displays summary of crash commands.
FILES
/usr/include/sys/*.h Header files for table and struc-
ture information.
/dev/mem Default system-image file.
/unix Default kernel-image file.
buf.# Files containing buffer data.
RELATED INFORMATION
The following commands: "mount," "nm," "ps," "sh,"
and "stty."