If a program terminates abnormally, a core file is created by the system to store a memory image of the terminated process. Errors such as memory address violations, illegal instructions, bus errors, and user-generated quit signals cause core files to be dumped.
The core file is named "core", and is placed in the directory where the application was running. Note that system core files are distinct from DB2 core files. See Dump Files for information on DB2 core files.
The dbx system command helps you determine which function caused a core file to be created. This is a simple check that will help you identify whether the database manager or DB2 Connect is in error, or whether an operating system or application error is responsible for the problem.
Notes:
dbx program_name core_filenamewhere program_name is the name of the program that terminated abnormally, and core_filename is the name of the file containing the core file dump.
The core_filename parameter is optional. If you do not specify it, the default name "core" is used.
The following example shows how to use the dbx command to read the core file for a program called "main".
dbx main
dbx version 3.1 for AIX. Type 'help' for help. reading symbolic information ... [using memory image in core] segmentation.violation in freeSegments at line 136 136 (void) shmdt((void *) pcAdress[i]); (dbx) where freeSegments(numSegs = 2, iSetId = 0x2ff7f730, pcAddress = 0x2ff7f758, line 136 in "main.c" main (0x1, 2ff7f7d4), line 96 in "main.c"
In the above example, the name of the function that caused the core dump is "freeSegments". If the function name begins with "db2", "sql", or "ddcs", it may indicate an error in the database manager or DB2 Connect products.
The example also illustrates the use of the where subcommand. Enter where at the dbx prompt to display the program path to the point of failure. In this example, the error occurred at line 136 of freeSegments, which was called from line 96 in "main.c".