Updated: October 28, 2024 |
Dump the postmortem state of a program (QNX)
dumper [-bFfIlmnPStvw] [-d path] [-E num] [-H size[G|M|K]] [-N max_files] [-p pid] [-s size[G|M|K]] [-U string] [-z level] &
QNX Neutrino
The secondary method queries the process manager for the memory mappings and then uses that list to create the link map. If the primary method fails, dumper tries the secondary one.
This option causes dumper to read parts of the process's address space that likely include hardware registers. When these registers are read, it may lead to side effects that can result in undefined and unsafe behavior, including system crashes or hanging.
To use this option at all, you must know the detailed behavior of every piece of hardware accessible to the processes being dumped. If you're running dumper in the background, it dumps any process that abnormally terminates, so all processes with access to hardware could be dumped and thus, all hardware accessible to processes could be examined. If you're manually running dumper with -p to save a dump file for a particular process, you have to worry about only the hardware accessible to this process.
In the second form, the primary group is the one specified for user_name in /etc/passwd.
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 .core extension. For example, if the program name is experiment, the dump is written to experiment.core in your home directory.
The -p option lets you get a dump immediately for a particular process. If you specify -p, dumper doesn't run in the background, but exits right away.
When dumper runs as a service it provides two client interfaces. The first client interface allows for notification of core dump creation through a devctl() interface. The second client interface allows for triggering a core dump by writing an (ASCII) process ID to /proc/dumper; this is how the OS triggers core dumps to happen.
To run as a service, dumper must maintain some high-risk privileges that allow it to:
To register for dump notifications, use the DCMD_DUMPER_NOTIFYEVENT devctl() command. You can also use the DCMD_DUMPER_GETPATH command to get the name of the dump file for a process and wait until the dump is finished. For more information, see Devctl and Ioctl Commands.
You can use a debugger such as gdb to examine a dump file:
gdb program_binary program_core
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 that it isn't prepared to handle. In the latter case, dumper writes a dump file for the following set of signals:
Signal | Description |
---|---|
SIGABRT | Program-called abort function |
SIGBUS | Parity error |
SIGEMT | EMT instruction (emulation trap)
Note that SIGEMT and SIGDEADLK refer to the same signal. |
SIGFPE | Floating-point error or division by zero |
SIGILL | Illegal instruction executed |
SIGQUIT | Quit |
SIGSEGV | Segmentation violation |
SIGSYS | Bad argument to a system call |
SIGTRAP | Trace trap (not reset when caught) |
SIGXCPU | Exceeded the CPU limit |
You can force the dump of a running program by setting one of the preceding signals, assuming that the program isn't masking or handling the signal itself.
For example, to force a dump using the kill command and a process ID (pid):
kill -SIGABRT pid
To force a dump using the slay utility and the process name:
slay -s SIGABRT process_name
Start dumper, with dump files to be written to the default directory:
dumper &
Start dumper, with dump files to be placed in the directory /home/dumps:
dumper -d /home/dumps &
The dumper utility normally doesn't terminate. However, it may terminate if it encounters an error on startup (for instance, if it wasn't run by root) or if it receives a signal.