DB2 10.5 for Linux, UNIX, and Windows

Trap files

DB2® generates a trap file if it cannot continue processing because of a trap, segmentation violation, or exception.

All signals or exceptions received by DB2 are recorded in the trap file. The trap file also contains the function sequence that was running when the error occurred. This sequence is sometimes referred to as the "function call stack" or "stack trace." The trap file also contains additional information about the state of the process when the signal or exception was caught.

A trap file is also generated when an application is forced to stop while running a fenced threadsafe routine. The trap occurs as the process is shutting down. This is not a fatal error and it is nothing to be concerned about.

The files are located in the directory specified by the diagpath database manager configuration parameter.

On all platforms, the trap file name begins with a process identifier (PID), followed by a thread identifier (TID), followed by the partition number (000 on single partition databases), and concluded with ".trap.txt".

There are also diagnostic traps, generated by the code when certain conditions occur which don't warrant crashing the instance, but where it is useful to see the stack. Those traps are named with the PID in decimal format, followed by the partition number (0 in a single partition database).

Examples:

You can generate trap files on demand using the db2pd command with the -stack all or -dump option. In general, though, this should only be done as requested by IBM Software Support.

You can generate stack trace files with db2pd -stacks or db2pd -dumps commands. These files have the same contents as trap file but are generated for diagnostic purposes only. Their names will be similar to 6881492.2.000.stack.txt.

Note: If you are sending Windows trap files to IBM® Support, ensure that you format your trap files before sending them to IBM Support in order to speed up the problem determination process. For information on how to format Windows trap files, see Formatting trap files (Windows)