crash(1L)                       Version 1.0                     08/11/88

Introduction

Crash is a utility for examining kernel tables while the system is
running, or if there is a facility for taking crash dumps, examining the
system after it has crashed.  SCO does not provide a crash dump facility
at this time, so that functionality is not present.

The kernel structures which can be examined at present are:

	block buffer headers
	open file table entries
	active inode table entries
	mounted file system table entries
	process table entries
	system statistics such as name, version, age
	active and sticky bit text table entries
	per process user page information
	tunable parameters

Using this information, it is possible to determine what files a given
process is using, what device they reside on, who owns them and where
the file pointer is currently positioned.  Other information on running
processes may also be determined.

This version of crash differs from most other versions, such as that
produced by AT&T for their UNIX(tm) systems, in that swapped user pages
may be printed and the name for swapped processes is given.  Also, not
all of the aliases which are listed in the manual page from AT&T are
provided.  A number of commands have been left out, and some of the
options for the included commands have been omitted as well.

Commands

Most commands take a list of table entries, which if not present
defaults to all elements in the table.

Print Buffer Headers
Syntax:	buf, b

Prints the selected block buffer headers.

Example:
> buf 0 1 2 3 4
 BUF MAJ  MIN    BLOCK FLAGS
   0 001 0047    20925 read done
   1 001 0037     2817 read done
   2 001 0050     2801 read done
   3 001 0037    15175 read done
   4 001 0050        6 done

Print Open File Table Entries
Syntax: file, f

Prints the selected open file table entries, with cross references
to the associated inodes, and the current file pointer.

Example:
> file 0 1 2 3 4
SLOT    FLAG          COUNT  INODE      OFFSET
   0    001 R             1      9           0
   1    003 RW            3      3          18
   2    003 RW            7     11       26800
   3    002  W            2      4         169
   4    001 R             1      8           0

Display Command Summary
Syntax: help, h, ?

Prints the list of currently available commands and the aliases
for them.

Example:
> help
command summary

buf (b)        - buffer headers
file (f)       - open files
help (h,?)     - list commands
inode (ino,i)  - active inodes
mount (m)      - mounted file systems
proc (p)       - active and defunct processes
quit (q,^D)    - exit crash
stat (s)       - crash statistics, age, time
text (t)       - active and sticky bit text segments
user (u)       - user page information
var (v)        - tunable parameters

Display Active Inode Table Entries
Syntax: inode, ino, i

Prints selected active inode table entries giving device, file
size, permissions, and owners.  Cross referenced from mount and
file tables.

Example:
> inode 0 2 6 8 20
SLOT MAJ  MIN INUMB REF LINK  UID  GID     SIZE    MODE SMAJ SMIN FLAGS
   0 001 0050     2   5   13    0    0      464 d---755    -    -
   2 001 0050    44   1    1    3    3    13472 f---700    -    - txt
   6 001 0050   204   1    2    0    0       32 d---777    -    - mnt
   8 001 0050    87   2    1   10   10        0 c---666 0004 0002
  20 001 0050   471   1    1    3    3    50102 f---711    -    - acc txt

Display Mounted File System Table Entries
Syntax: mount, m

Prints the system entries for mounted on file systems.  The
device, mount point, file system sizes and free blocks and inodes
are displayed.

Example:
> mount
SLOT  MAJ  MIN  INODE  BUF  VOLUME  PACK   BLOCKS INODES  BFREE  IFREE
   0    1  050      0   10                   7163   1808   1237   1251
   1    1  037      6  230  usr     rpp386  34000  17024   1320  14238
   2    1  047      7  245                  22950  15024   5499   9800
   3    2  064     23  387                   1200    320    210     50

Display Process Table Entries
Syntax: proc, p

Prints selected running and defunct process information.  The process
ids, user ids, CPU usage, scheduling priority and wait event are
displayed.  The process name is determined by locating the user page.

Example:
> proc 0 1 2 3 4
SLT ST  PID  PPID  PGRP   UID  EUID PRI CPU    EVENT NAME       FLAGS
  0 s     0     0     0     0     0   0  15    16c5c swapper    incore sched
  1 s     1     0     0     0     0  30   0     eeac init       incore text
  2 s  9389     1  9389   100   100  30   0     ef54 csh        incore text
  3 s    31     1     0     0     0  26   0     5eac logger     swapped
  4 s    30     1     0     0     0  40   0  6000000 update     incore text

Exit Crash Command
Syntax: quit, q, ^D

Exits Crash.

Example:
> quit
$

Print System Statics
Syntax: stat, s

Prints information regarding system name, operating system release, version,
date of crash, and uptime at time of crash.

Example:
> stat
	sysname: XENIX
	nodename: rpp386
	release: 2.2.1
	version: SysV
	machine: i80386
	time of crash: Thu Aug 11 11:18:00 1988
	age of system: 35 days, 23 hrs., 7 mins.

Print Text Table Entries
Syntax: text, t

Prints current text table entries.  Cross references to inode number
and process table entry and gives the number of processes which are
currently referencing this table entry.
Example:
> text 0 1 2 3 4
SLOT  INODE  REF  LDREF  PROC  SWAPLO+   SIZE  FLAGS
   0      2    1      1     1        0      0  write
   1     20    2      1     9        0      0  write
   2      5    1      1     4        0      0  write
   3     10    1      0     0        0      0  write
   4     21    1      1    10        0      0  write

Print Per Process User Page Information
Syntax: user, u

Prints the user page for the current process or a group of processes.
The argument is the process table slot.  If omitted, the currently
running process, which will invariably be crash, user page will be
displayed.  Information includes user and system times, user and
group ids, file I/O, system accounting and open file information.
Provides a list of currently open files by file table entry number.

Example:
> user
PER PROCESS USER AREA:
USER ID's:	uid: 100, gid: 0, real uid: 100, real gid: 0
PROCESS TIMES:	user: 16, sys: 22, child user: 0, child sys: 0
PROCESS MISC:	proc slot: 10, cntrl tty: maj(0) min(0)
IPC:		locks: unlocked
FILE I/O:	user addr: 25703640, file offset: 100665344, bytes: 1892,
		segment: user, umask: 22, ulimit: 2097152
ACCOUNTING:	command: crash, memory: 1987167, type: exec
		start: Thu Aug 11 11:28:10 1988
OPEN FILES:	file desc:     0   1   2   3   4   5
		file slot:    11  13  13  18  19  20

Print Tunable Parameter Information
Syntax: var, v

Displays the tunable parameter values which were used at the time
of system generation.  Included are number of open files, processes
per user, inodes, mounts, pure text entries and other related
information.

Example:
> var
buffers	  512
calls	   30
inodes	  100
e_inodes  100
files	  100
e_files	  100
mounts	    8
e_mounts    8
procs	   60
e_procs	   16
texts	   40
e_texts	   40
clists	   64
sabufs	   64
maxproc	   30
hashbuf	  512
hashmask  511

Caveats and Features

This release of crash is known to run under SCO Xenix 2.2.1.  No other
ports are presently known of.  For the most part, porting to a different
release of Xenix should be quite painless.  The principle changes are
likely to be in the user area and process table entries.

None of the options are presently implemented.  Commands which have been
implemented have only one format.

All of the commands are available as command line options.  Use the one
letter command alias as the command line option.  The output defaults
to what it would be if that one letter alias were issued to crash as a
command.  Multiple flags may be given.  When in doubt, read the source.
