Accessing system core file information (Linux and UNIX)

The dbx system command helps you determine which function caused a system core file to be created. This is a simple check that will help you identify whether the database manager is in error, or whether an operating system or application error is responsible for the problem.

Before you begin

  • You must have the dbx command installed. This command is operating system-specific: on AIX®, use dbx, and on Linux® use gdb.
  • On AIX, ensure that the full core option has been enabled using the chdev command or smitty.

Procedure

To determine the function that caused the core file dump to occur:

  1. Enter the following command from a UNIX command prompt:
    dbx program_name core_filename
    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.
  2. Examine the call stack in the core file. Information about how to do this can be obtained by issuing man dbx from a UNIX command prompt
  3. To end the dbx command, type quit at the dbx prompt.

Example

The following example shows how to use the dbx command to read the core file for a program called "main".
  1. At a command prompt, enter:
    dbx main
  2. Output similar to the following appears on your display:
    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 *) pcAddress[i]);
    
    
  3. The name of the function that caused the core dump is "freeSegments". Enter where at the dbx prompt to display the program path to the point of failure.
    (dbx) where
    freeSegments(numSegs = 2, iSetId = 0x2ff7f730, pcAddress = 0x2ff7f758, line
    136
    in "main.c"
    main (0x1, 2ff7f7d4), line 96 in "main.c"
    In this example, the error occurred at line 136 of freeSegments, which was called from line 96 in main.c.
  4. To end the dbx command, type quit at the dbx prompt.