ccoorree -- System Administration

Format of a core-dump file
#iinncclluuddee <ssyyss/ccoorree.hh>

When  a   process  terminates  abnormally   because  a  it   encounters  an
unrecoverable  error  or  receives  an  asynchronous  signal  from  another
process, COHERENT tries to write a  copy of its image in memory into a file
called ccoorree. You can examine this file with the debugger ddbb and other tools
to try to determine what went wrong.

The structure cchh_iinnffoo appears at the  head of a ccoorree file.  The header file
ccoorree.hh defines it as follows:

    struct  ch_info {
        unsigned short ch_magic;
        unsigned int ch_info_len;
    };

Field cchh_mmaaggiicc  is always  set to  the constant CCOORREE_MMAAGGIICC.  This ``magic''
value signifies  to COHERENT that  this is a core  file.  Field cchh_iinnffoo_lleenn
gives a count of information bytes  in the core file, including the cchh_iinnffoo
structure itself.

If the value of cchh_iinnffoo_lleenn exceeds the size of the cchh_iinnffoo structure, this
indicates that  data follow the  cchh_iinnffoo structure.  These  data follow the
cchh_iinnffoo structure,  and are in  the form of a  ccoorree_pprroocc structure.  Header
file <ssyyss/ccoorree.hh> defines this structure as follows:

    struct core_proc {
        gregset_t cp_registers;
        int cp_signal_number;
        struct _fpstate cp_floating_point;
        dregset_t cp_debug_registers;
    };

This substitutes  for a dump of  the uu area, whose  information is reserved
for the kernel alone.

This is  followed by an image  of each process segment.   The data for each
segment consists of  the following: a header, which is  a structure of type
ccoorree_sseegg; ccss_ppaatthhlleenn bytes of data that give the path name of the file from
the segment data originated; and ccss_dduummppeedd bytes of core-image data.

ccoorree.hh defines strucutre ccoorree_sseegg as follows:

     struct core_seg {
          size_t cs_pathlen;            /* length of path name */
          off_t cs_dumped;              /* dumped size in bytes */
          caddr_t cs_base;              /* virtual base address */
          off_t cs_size;                /* full size in bytes */
          unsigned long cs_reserved[8];
     };

The order  of the segments is  the text segment first (if  it is present --
usually it  is omitted), followed by  the data segment, and  then the stack
segment.  The  contents of the text segment can  usually be identified from
the program being debugged.  The patchable kernel variable DDUUMMPP_TTEEXXTT allows
the  COHERENT kernel  to  dump text  segments  as well  as  data and  stack
segments.

Patchable  kernel variable  DDUUMMPP_LLIIMM  sets the  maximum size  of a  segment
within a  ccoorree file.  The  system uses this  limit to keep  keep core files
from getting out of hand.

_S_e_e _A_l_s_o
AAddmmiinniisstteerriinngg CCOOHHEERREENNTT, ccoorree.hh, ssiiggnnaall(), wwaaiitt()

_D_i_a_g_n_o_s_t_i_c_s
COHERENT will not write ccoorree if  that file already exists as a non-ordinary
file or if  there is more than one link to  it.  The 0200 bit in the status
returned to the parent process by wwaaiitt() indicates a successful dump.

For  a list  of signals  that automatically  trigger a  core dump,  see the
Lexicon entry for ssiiggnnaall().
