core File Format (AIX 4.3)

Purpose

Contains an image of a 32-bit or 64-bit process at the time of an error.

Description

A core file is created in the current directory when various errors occur. Errors such as memory-address violations, illegal instructions, bus errors, and user-generated quit signals commonly cause this core dump. The core file that is created contains a memory image of the terminated process. A process with a saved user ID that differs from the real user ID does not produce a memory image. The contents of a core dump are organized sequentially in the core file as follows:

Item Description
Core header Defines basic information about the core dump, and contains offsets that locate the remainder of the core dump information.
ldinfo structures Defines loader information.
thrdctx structures Defines kernel thread state information. Since the faulting thread thrdctx structure is directly saved in the core header, additional structures are saved here only for multi-threaded programs.
segregion structures Contains the address, size, and type for shared memory segments of the faulting process.
Default user stack Contains a copy of the user stack at the time of the core dump.
Default data area (Optional) Contains the user data section.
vm_infox structures (Optional) Contains offset and size information for memory mapped regions.
Memory mapped regions (Optional) Contains the memory mapped regions.

The core_dumpx structure, defined by the core.h file, occurs at the beginning of a core file. The core_dumpx structure includes the following fields:

Item Field Name Description
char c_signo The number of the signal which caused the error.
char c_flag A bit field which describes the core dump type. The meanings of the bits are as follows:
FULL_CORE
core contains the data sections (0x01)
CORE_VERSION_1
core was generated by AIX® Version 4 or higher (0x02)
MSTS_VALID
core contains mstsave structures (0x04)
CORE_BIGDATA
core contains big data (0x08)
UBLOCK_VALID
core contains the u_block structure (0x10)
USTACK_VALID
core contains the user stack (0x20)
LE_VALID
core contains at least one module (0x40)
CORE_TRUNC
core was truncated (0x80)
ushort c_entries The number of core dump modules
struct ld_info * c_tab The offset to the beginning of the core table
caddr_t c_stack The offset to the beginning of the user stack
int c_size The size of the user stack
struct mstsave c_mst A copy of the faulting mst
struct user c_u A copy of the user structure
int c_nmsts The number of mstsave structures referenced by the c_msts field
struct mstsave * c_msts The offset to the other threads' mstsave structures
int c_datasize The size of the data region
caddr_t c_data The offset to user data
int c_vmregions The number of anonymously mapped regions
struct vm_info * c_vmm The offset to the start of the vm_info table

The c_flt field in the core dump contains the thrdctx structure of the faulting thread. The thrdctx structure includes the thread data and registers as they existed at the time of the fault. The format of the thread context structure is defined by thrdctx structure (in the core.h header file) as follows:

Item Description
thrdctx thrdsinfo64 __context64 mstsave thread data (in procinfo.h header file) state of registers if 64-bit process, or state of registers if 32-bit process

The c_u field follows this information in the core dump. The c_u field contains the userx structure including the user structure fields, and the process data as they existed at the time of the fault. The format of the process information structure is defined by the userx structure (in the core.h header file) as follows:

Item Description
userx procsinfo64 process data (in procinfo.h header file)

The ld_info structure and then the thrdctx structures of the other threads (if the process is multi-threaded) follow in the core dump.

The segregion structure and then the user-mode stack follow in the core dump.

The segregion structure contains the information about a shared memory region of the faulting process.

Item Description
segregion addr size segflags segment start address size of the segment type of the document

The first three fields of the core_dumpx header in AIX 4.3 are the same as that of the core_dump header in AIX 4.2. However, the c_entries are always zero on AIX 4.3 systems to distinguish them from the AIX 4.2 core file formats. Further, the pi_flags2 field of the procsinfo64 structure determines if the core file is of a 32-bit process or a 64-bit process.

The AIX 4.3 operating system can be forced to create core files in a AIX 4.2 core file format via the SMIT tool. However, this enforcement is valid only for 32-bit processes.

By default, the user data, anonymously mapped regions, and vm_infox structures are not included in a core dump. This partial core dump includes the current thread stack, the thread thrdctx structures, the user structure, and the state of the registers at the time of the fault. A partial core dump contains sufficient information for a stack traceback. The size of a core dump can also be limited by the setrlimit or setrlimit64 subroutine.

To enable a full core dump, set the SA_FULLDUMP flag in the sigaction subroutine for the signal that is to generate a full core dump. If this flag is set when the core is dumped, the user data section, vm_infox, and anonymously mapped region structures are included in the core dump.