dumper

Dump the postmortem state of a program (QNX)

Syntax:

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] &

Runs on:

QNX Neutrino

Options:

-b
(QNX Neutrino 6.6 or later) Attempt to slog a backtrace (libbacktrace.so.1 must be available).
-d path
The directory in which to place dumps. The default is the home directory of user that started the process, or /tmp if none.
-E num
(QNX Neutrino 7.0 or later) The maximum size for the list of the names of the most recent dump files. The default is 10.
-F
(QNX Neutrino 6.6 or later) Run at a fixed priority.
-f
(QNX Neutrino 6.6 or later) Follow soft links for the creation of the dump files. The use of this option has security implications.
-H size[G|M|K]
(QNX Neutrino 7.0 or later) Suppress the dumping of memory if the memory usage is greater than size.
-I
(QNX Neutrino 7.0 or later) Include the process ID in the core file's name.
-l
(“el”; QNX Neutrino 7.0 or later) Use an alternative method of finding the linkmap.
-m
Don't dump memory.
-N max_files
(QNX Neutrino 6.6 or later) Save sequential dumps in a log-rotation fashion, to a maximum of max_files files. The behavior is identical to that described for the -n option, except that when a new core file is generated, all existing files named executable.number.core with number greater than or equal to max_files are deleted.
-n
Save sequential dumps in a log-rotation fashion. The latest dump is named executable.core, and older core files are kept as executable.number.core, where number starts at 1 and increases with the core file's age. Every time a new core file is created, the existing files' numbers are incremented by 1, and the previous executable.core is renamed executable.1.core.
-P
Dump the physical memory mappings.
-p pid
Save a dump file for this process immediately, and then exit dumper.
-S
(QNX Neutrino 6.6 or later) Disable the dumping of shared memory mappings.
-s size[G|M|K]
Set the default maximum core size, in bytes. You can override this for a process by setting its RLIMIT_CORE resource; see the entry for setrlimit() in the QNX Neutrino C Library Reference.
-t
Dump the stack of the errant thread only, instead of for all threads.
-U string
(QNX Neutrino 6.6 or later) Once running, run as the specified user, so that the program doesn't need to run as root. The string can be in one of these forms:
  • uid[:gid[,sup_gid]*]
  • user_name[,sup_gid]*

In the second form, the primary group is the one specified for user_name in /etc/passwd.

-v
Be verbose.
-w
Make core files world-readable.
-z level
Use gzip to compress the core files. The compression level must be in the range from 1 (fastest) through 9 (best compressed).

Description:

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.

Note: Dump files can be large, so make sure the destination filesystem has lots of space.

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.

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

Examples:

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 &

Files:

/proc/dumper
A special entry in the /proc filesystem (see procnto*) that receives notification when a process terminates abnormally.

Exit status:

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.

0
A signal was received and dumper shut down successfully.
1
An error was encountered on startup (not run by root or bad command-line options).