HPlogo STREAMS/UX for the HP 9000 Reference Manual > Chapter 6 Debugging STREAMS/UX Modules and Drivers

Generating and Retrieving System Core Dumps

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

HP-UX will attempt to create a snapshot of physical memory and register contents before it stops running. This snapshot can assist engineers in determining the cause of the problem because it holds a record of what the system was doing at the time it crashed. The correct name for this snapshot is a core dump. The default location for this snapshot is the primary swap area, but it is possible to configure systems to put the snapshot on another disk device. See the System Administration Tasks manuals for the Series 700 and the Series 800 for information on configuring dump devices.

A core dump is composed of two files, a core file and an object file. The core file is an image of the system's physical memory and register contents at the time of a crash. The object file is the kernel file, /stand/vmunix.

To retrieve a core dump, the program /usr/sbin/savecore must be executed. savecore will retrieve the core file from the swap device, along with a copy of the system's kernel file, and save both in a specified directory. The core file and the kernel file make up the core dump pair (for example, vmcore.N and vmunix.N where N is a number that associates a core dump pair).

adb and strdb require that both members of a core dump pair be present. In addition, it is very important that these members match for adb and strdb to be effective. They must match because the kernel (vmunix.N) file contains information which is used by adb and strdb as a road map into the core (vmcore.N) file.

Setting Up Your System To Save a Core Dump

In order to have system core dumps saved automatically during boot-up, the savecore function must be enabled in the system's /etc/rc.config file. Search this file for the string SAVECORE and follow the instructions in the comments.

Manually Getting a Core File from the Swap Partition

If savecore() was not run at boot-up, or did not succeed, you can still run savecore(1m) manually by taking the following steps:

/usr/bin/bdf                     # find enough space for the dump
mkdir /tmp/syscore # assuming /tmp has enough space
/usr/sbin/savecore /tmp/syscore # savecore to the chosen directory

savecore begins by reporting the date and time of the crash. Next, it looks in the specified directory for a file named bounds. The bounds file contains the next sequence number (N), which savecore will use to create a unique core file and kernel file. savecore will copy the core image from the primary swap device to a file named vmcore.N. Lastly, savecore copies /stand/vmunix to a file named vmunix.N to complete the core dump pair.

Problems Encountered In Saving/Obtaining a Core Dump

If /stand/vmunix was not the kernel that was running when the crash occurred, savecore will exit quickly without printing any message and will not save the core file. Use the -d option to tell savecore what kernel was running at the time of the system crash:

/usr/sbin/savecore -d /stand/vmunix.bad /var/adm/crash

If a core dump pair is incomplete or not saved after a panic, you can look to the savecore(1m) man page for help.

Transfer of Control In Case of System Hang

A system hang is a situation in which the system seems to be up but does not respond to external user control. Should this happen to your system, you will want to obtain a core dump so that the cause for the hang can be analyzed. The method for obtaining a core dump of a kernel in this state is to use the Transfer of Control (TOC) mechanism. The TOC mechanism causes the machine to vector through a special address which will cause the machine to do a core dump. Most Series 700 and 800 machines have the capability to perform TOC but the methods for performing this task are machine-dependent:

  • Series 800 Models 850, 855, 86x, F, G, H, I, and 870: If you have an access port connected to your machine, you must enable it through your front panel. Next, type a "Control b" on the console. This will put your console under the supervision of the access port. You will get a "CM>" prompt, at which you may type "TC."

  • Series 800 Models 834/5, 845, and 8x2 have a key-operated TOC mechanism. To execute a TOC, turn the key all the way to the right (clockwise).

  • Series 800 Models 808 and 815 have a button-operated TOC mechanism. From the rear of the machine, look for this button on the lower right-hand side (it will be marked TOC). You will need an object, like a pen, to push the TOC button.

  • Series 700s have a button-operated TOC mechanism. The button is on the right side front of the computer. Pull open the door covering the system activity LED's, and the TOC button is the small white button on the far left.

Core File Size Requirements

It is best if the size of the vmcore.N file is equal to that of the machine's physical memory. Because the core file is an image of memory at the time of a crash, if its size is not equal to the machine's physical memory size, some information will be lost. However, it is still possible to get some information from a partial core dump.

Symbol Information

Make sure that the vmunix.N file has not been stripped. adb and strdb will not work without symbol information. Use the file command to confirm that the symbols have not been stripped:

file vmunix.0
vmunix.0 s800 executable -not stripped
© 1995 Hewlett-Packard Development Company, L.P.