Dump postmortem state of a program (QNX)
dumper [-d path] [-p pid] [-s] &
The dumper utility runs in the background and provides a postmortem dump service for all processes. Whenever a program terminates abnormally, a dump of the current state of the program is written to disk. The dump filename is the same as the program name with a .dmp extension. For example, if the program name is experiment the dump will be written to the /home/userid/experiment.dmp file.
You can use the -d option to force all dumps into a single directory rather than into the invoking user's home directory.
The -p option lets you monitor a particular process. You can run multiple copies of dumper, each monitoring a different process.
A dump file may be examined using a debugger:
wd -tr=pmd programname.dmp
The dump file format is described in the /usr/include/sys/dumper.h C header file.
A program may terminate in one of two ways. It may exit cleanly under its own control, returning an exit status, or it may be forcibly terminated by the receipt of a signal it is not prepared to handle. In the latter case, dumper will write a dump file for the following set of signals:
Signal | Description |
---|---|
SIGABRT | program-called abort function |
SIGBUS | parity error |
SIGFPE | floating-point error or divide by zero |
SIGILL | illegal instruction executed |
SIGSEGV | segmentation violation |
You can force the dump of a running program by setting one of the preceding signals, assuming that the program is not masking or handling the signal itself. For example:
Start dumper, with dump files to be written to the home directory of the user who was running the process being dumped:
dumper &
Start dumper, dump files to be placed in the directory /home/dumps:
dumper -d /home/dumps &
After initialization has been completed, dumper closes its standard input, standard output and standard error file descriptors. If an error is encountered during initialization, a diagnostic message is written to standard error before dumper terminates. Other than this, no output is produced to these files.
The dumper utility will create dump files in the home directory of the user who was running the program being dumped. These files will be named /home/userid/program.dmp. The directory may be different if the -d path option was specified on the command line.
The dumper utility normally does not terminate. However, it may terminate if it encounters an error on startup (for instance, if it was not run by root) or if it receives a signal.