BSD 4_1c_2 development
[unix-history] / usr / man / man8 / crash.8
index a0615ff..32864f0 100644 (file)
-.TH CRASH 8 VAX-11
-.UC
-.tr |
+.TH CRASH 8V "1 September 1981"
+.UC 4
 .SH NAME
 .SH NAME
-crash \- what to do when the system crashes
+crash \- what happens when the system crashes
 .SH DESCRIPTION
 .SH DESCRIPTION
-This section gives at least a few clues about how to proceed if the
-system crashes.
-It can't pretend to be complete.
+This section explains what happens when the system crashes and how
+you can analyze crash dumps.
 .PP
 .PP
-.I "What to do first.||"
-(Someday the LSI-11 will do this automatically.)
-If the reason for the crash is not evident
-(see below for guidance on `evident')
-you may want to try to dump the system if you feel up to
-debugging.
-At the moment a dump can be taken only on magnetic tape.
-Before you do anything, be sure that a clean tape is mounted with a ring-in
-on the tape drive if you plan to make a dump.
-.PP
-Write the date and time on the console log.
-Use the console commands to examine the registers, program status long word,
-and the top several locations on the stack.
-A suggested command sequence, which is executed by the ``@DUMP''
-console command script, is:
-.DS
-.nf
-       E PSL<return>
-       E R0/NE:F<return>
-       E SP<return>
-       E/V @ /NE:40<return>
-.fi
-.DE
-If hardware problems dictate a special set of commands be executed when
-the system crashes, a sequence of commands can be saved using the console
-command ``LINK'' to be reexecuted with ``PERFORM'' (which can be
-abbreviated ``P'').
-If a dump is to be taken on magnetic tape (this is a good idea
-in most any case where the cause of the crash is not immediately obvious)
-then the following commands will (should) be executed:
-.DS
-.nf
-       D PSL 0<return>
-       D PC 80000200<return>
-       C<return>
-.fi
-.DE
-These commands are actually part of the standard ``@DUMP'' script.
-This should write a copy of all of memory
-on the tape, followed by two EOF marks.
-Caution:
-Any error is taken to mean the end of memory has been reached.
-This means that you must be sure the ring is in,
-the tape is ready, and the tape is clean and new.
-.PP
-If there are not 40 locations active on the kernel stack when the
-procedure is begun, then the console may begin to print error diagnostics.
-You can stop this by hitting ``^C'' (control-C), and then give the
-last three commands above.
-.PP
-If the dump fails, you can try again,
-but some of the registers will be lost.
-See below for what to do with the tape.
-.PP
-.I "How to bring it back up.||"
-To restart after a crash, follow the directions in
-.IR bproc (8);
-if the virtual memory subsystem is suspected as the cause of the crash,
-then a version of the system other than ``vmunix'' should be booted;
-this version of the system will leave the paging areas temporarily intact
-for use by the post-mortem analysis program
-.I analyze.
-On Ernie Co-vax at UCB, the backup system is ``unix''.
-When this system is running, check its root file system (currently
-.I /dev/rrm0a
-but this is likely to change), and then read the core tape into the
-file
-.I /vmcore,
-with the command:
-.IP
-cp /dev/mt0 /vmcore
-.LP
-With the system still in single-user mode, run the analysis program
-.I analyze,
-i.e.:
+When the system crashes voluntarily it prints a message of the form
 .IP
 .IP
-analyze \-s /dev/drum /vmcore /vmunix
+panic: why i gave up the ghost
 .LP
 .LP
-and save the output.
-Be sure to boot up
-``vmunix''
-before coming up multi-user.
-.PP
-Do a
-.I sync,
-and proceed to check and fix all file systems,
-performing a
-.I dcheck
-and
-.IR  icheck (1)
-on all file systems which could have been in use at the time
-of the crash.
-If any serious file system problems are found, they should be repaired.
-When you are satisfied with the health of your disks,
-log out by typing an EOT (<control-D>).
-The command sequence in /etc/rc will be executed and the system will
-be in multi-user mode.
-.PP
-To even boot \s8UNIX\s10 at all,
-three files (and the directories leading to them)
-must be intact.
-First,
-the initialization program
-.I /etc/init.vm
-must be present and executable.
-If it is not,
-then the cpu will loop at location 0x13.
-For
-.I init.vm
-to work correctly,
-.I /dev/console
-and
-.I /bin/sh
-must be present.
-If either does not exist,
-the symptom is best described
-as thrashing.
-.I Init
-will go into a
-.I fork/exec
-loop trying to create a
-Shell with proper standard input and output.
-.PP
-If you cannot get the system to boot,
-a runnable system must be obtained from
-a backup medium.
-The root file system may then be doctored as
-a mounted file system as described below.
-If there are any problems with the root
-file system,
-it is probably prudent to go to a
-backup system to avoid working on a
-mounted file system.
-.PP
-.I "Repairing disks.||"
-The first rule to keep in mind is that an addled disk
-should be treated gently;
-it shouldn't be mounted unless necessary,
-and if it is very valuable yet
-in quite bad shape, perhaps it should be dumped before
-trying surgery on it.
-This is an area where experience and informed courage count for much.
-.PP
-The problems reported by
-.I icheck
-typically fall into two kinds.
-There can be
-problems with the free list:
-duplicates in the free list, or free blocks also in files.
-These can be cured easily with an
-.I "icheck \-s."
-If the same block appears in more than one file
-or if a file contains bad blocks,
-the files should be deleted, and the free list reconstructed.
-The best way to delete such a file is to use
-.IR  clri (1),
-then remove its directory entries with
-.IR rm (1).
-(Do not use
-.IR mv (1).)
-If any of the affected files is really precious,
-you can try to copy it to another device
-first.
-.PP
-.I Dcheck
-may report files which
-have more directory entries than links.
-Such situations are potentially dangerous;
-.I clri
-discusses a special case of the problem.
-All the directory entries for the file should be removed.
-If on the other hand there are more links than directory entries,
-there is no danger of spreading infection, but merely some disk space
-that is lost for use.
-It is sufficient to copy the file (if it has any entries and is useful)
-then use
-.I clri
-on its inode and remove any directory
-entries that do exist.
-.PP
-Finally,
-there may be inodes reported by
-.I dcheck
-that have 0 links and 0 entries.
-These occur on the root device when the system is stopped
-with pipes open, and on other file systems when the system
-stops with files that have been deleted while still open.
-A
-.I clri
-will free the inode, and an
-.I "icheck -s"
-will
-recover any missing blocks.
-.PP
-.I "Why did it crash?||"
-UNIX types a message
-on the console typewriter when it voluntarily crashes.
-Here are some of the possible panic messages,
-with enough information to provide
-a hope at least of the remedy.
-The message has the form `panic: ...',
-`Trap from kernel mode', or `ILL I/E VEC'
-(possibly accompanied by other information).
-In rare cases the system will ``panic'' but the console message
-will not appear; if this happens, you can trace the message easily
-through the variable
-.I panicstr
-in the system.
-Left unstated in all cases
-is the possibility that hardware or software
+on the console, takes a dump on a mass storage peripheral,
+and then invokes an automatic reboot procedure as
+described in
+.IR reboot (8).
+(If auto-reboot is disabled on the front panel of the machine the system
+will simply halt at this point.)
+Unless some unexpected inconsistency is encountered in the state
+of the file systems due to hardware or software failure the system
+will then resume multi-user operations.
+.PP
+The system has a large number of internal consistency checks; if one
+of these fails, then it will panic with a very short message indicating
+which one failed.
+.PP
+The most common cause of system failures is hardware failure, which
+can reflect itself in different ways.  Here are the messages which
+you are likely to encounter, with some hints as to causes.
+Left unstated in all cases is the possibility that hardware or software
 error produced the message in some unexpected way.
 error produced the message in some unexpected way.
-.HP 5
-blkdev
-.br
-The
-.I getblk
-routine was called with a nonexistent major device as argument.
-Definitely hardware or software error.
-.HP 5
-devtab
-.br
-Null device table entry for the major device used as argument to
-.I getblk.
-Definitely hardware or software error.
-.HP 5
-iinit
-.br
-An I/O error reading the super-block for the root file system
-during initialization.
-.HP 5
-out of inodes
-.br
-A mounted file system has no more i-nodes when creating a file.
-Sorry, the device isn't available;
-the
-.I icheck
-should tell you.
-.HP 5
-no fs
-.br
-A device has disappeared from the mounted-device table.
-Definitely hardware or software error.
-.HP 5
-no imt
-.br
-Like `no fs', but produced elsewhere.
-.HP 5
-no inodes
-.br
-The in-memory inode table is full.
-Try increasing NINODE in param.h.
-Shouldn't be a panic, just a user error.
-.HP 5
-IO error in swap
-.br
-An unrecoverable I/O error during a swap.
-Really shouldn't be a panic.
-.HP 5
-out of swap
-.br
-A program needs to be swapped out, and there is no more swap space.
-It has to be increased.
-This really shouldn't be a panic.
-.HP 5
-out of text
-.br
-A pure procedure program is being executed,
-and the table for such things is full.
-This shouldn't be a panic.
-.HP 5
-trap from kernel mode
-.br
-An unexpected trap has occurred within the system.
-The trap type can be determined by examining the top word of the
-stack (the trap type) with the console commands.
-The trap types are:
-.TP 10
-0
-reserved addressing mode
-.br
-.ns
-.TP 10
-1
-privileged instruction
-.br
-.ns
-.TP 10
-2
-BPT
-.br
+.TP
+.B IO err in push
 .ns
 .ns
-.TP 10
-3
-XFC
-.br
+.TP
+.B hard IO err in swap
+The system encountered an error trying to write to the paging device
+or an error in reading critical information from a disk drive.
+You should fix your disk if it is broken or unreliable.
+.TP
+.B timeout table overflow
 .ns
 .ns
-.TP 10
-4
-reserved operand
-.br
+This really shouldn't be a panic, but until we fix up the data structure
+involved, running out of entries causes a crash.  If this happens,
+you should make the timeout table bigger.
+.TP
+.B KSP not valid
 .ns
 .ns
-.TP 10
-5
-CHMK (system call)
-.br
+.TP
+.B SBI fault
 .ns
 .ns
-.TP 10
-6
-arithemtic trap
-.br
+.TP
+.B CHM? in kernel
+These indicate either a serious bug in the system or, more often,
+a glitch or failing hardware.
+If SBI faults recur, check out the hardware or call
+field service.  If the other faults recur, there is likely a bug somewhere
+in the system, although these can be caused by a flakey processor.
+Run processor microdiagnostics.
+.TP
+.B machine check %x:
+.I description
 .ns
 .ns
-.TP 10
-7
-reschedule trap (software level 3)
-.br
-.ns
-.TP 10
-8
-segmentation fault
-.br
+.TP
+.I \0\0\0machine dependent machine-check information
 .ns
 .ns
-.TP 10
-9
-protection fault
-.br
-.ns
-.TP 10
-10
-trace pending (TP bit)
-.HP 5
-ILL I/E VEC, HALTED AT xx
-.br
-an illegal interrupt or exception has occurred.  The possible addresses are
-.ns
-.TP 10
-4
-machine check (hardware error).
-.br
-.ns
-.TP 10
-8
-kernel stack not valid
-.br
-.ns
-.TP 10
-C
-power failure
-.PP
-In some of these cases it is
-possible for octal 20 to be added into the trap type;
-this indicates that the processor was in user mode when the trap occurred.
-If you wish to examine the stack after such a trap,
-either dump the system, or use the console to examine memory;
-the required address mapping is described below.
-.PP
-There are also a large number of panics if internal consistency
-checks in the paging subsystem fail.  These can be caused by hardware
-(e.g. if disk or tape problems cause a data structure to be mutilated)
-but are most often caused by software problems.
-Refer to a system listing to locate these and other panics not discussed above.
-.PP
-.I "Interpreting dumps.||"
-All file system problems
-should be taken care of before attempting to analyze dumps.
-As mentioned above, the dump tape should be read into the file
-.IR /vmcore ;
-.IR  cp (1)
-will do.
-At this point, you should execute
+We should describe machine checks, and will someday.
+For now, ask someone who knows (like your friendly field service people).
+.TP
+.B trap type %d, code=%d, pc=%x
+A unexpected trap has occurred within the system; the trap types are:
+.sp
+.nf
+0      reserved addressing fault
+1      privileged instruction fault
+2      reserved operand fault
+3      bpt instruction fault
+4      xfc instruction fault
+5      system call trap
+6      arithmetic trap
+7      ast delivery trap
+8      segmentation fault
+9      protection fault
+10     trace trap
+11     compatibility mode fault
+12     page fault
+13     page table fault
+.fi
+.sp
+The favorite trap types in system crashes are trap types 8 and 9,
+indicating
+a wild reference.  The code is the referenced address, and the pc at the
+time of the fault is printed.  These problems tend to be easy to track
+down if they are kernel bugs since the processor stops cold, but random
+flakiness seems to cause this sometimes.
+.TP
+.B init died
+The system initialization process has exited.  This is bad news, as no new
+users will then be able to log in.  Rebooting is the only fix, so the
+system just does it right away.
+.PP
+That completes the list of panic types you are likely to see.
+.PP
+When the system crashes it writes (or at least attempts to write)
+an image of memory into the back end of the primary swap
+area.  After the system is rebooted, the program
+.IR savecore (8)
+runs and preserves a copy of this core image and the current
+system in a specified directory for later perusal.  See
+.IR savecore (8)
+for details.
+.PP
+To analyze a dump you should begin by running
 .I "ps \-alxk"
 .I "ps \-alxk"
-and
-.I who
-to print the process table and the users who were on
-at the time of the crash.
+to print the process table at the time of the crash.
 Use
 .IR adb (1)
 to examine
 .IR /vmcore .
 The location
 Use
 .IR adb (1)
 to examine
 .IR /vmcore .
 The location
-.I dumpstack\-80000000
+.I _rpb+0t508
 is the bottom of a stack onto which were pushed the stack pointer
 .BR sp ,
 .B PCBB
 is the bottom of a stack onto which were pushed the stack pointer
 .BR sp ,
 .B PCBB
@@ -409,11 +140,18 @@ an idea of what is wrong.
 A more complete discussion
 of system debugging is impossible here.
 See, however,
 A more complete discussion
 of system debugging is impossible here.
 See, however,
-.IR analyze (1)
+.IR analyze (8)
 for some more hints.
 .SH "SEE ALSO"
 for some more hints.
 .SH "SEE ALSO"
-analyze(1m), clri(1), icheck(1), dcheck(1), bproc(8)
+adb(1),
+analyze(8),
+reboot(8)
 .br
 .I "VAX 11/780 System Maintenance Guide"
 for more information about machine checks.
 .SH BUGS
 .br
 .I "VAX 11/780 System Maintenance Guide"
 for more information about machine checks.
 .SH BUGS
+There should be a better program than
+.IR analyze (8)
+available which prints out more of the system
+state symbolically after a crash to lessen the tedious
+tasks involved in crash analysis.