Skip to main content

Background:

Setting the core_on_error run-time tunable can be useful for debugging runtime errors.

As described in the documentation, core_on_error can be set to values 1, 2, or 3.

Value 1 produces a core file for any system exception that would normally produce a run-time system error 114 (for example, SIGBUS and SIGSEGV).

Value 2 produces a core file when any COBOL run-time system error occurs (not just a system exception). After writing out the core file the process terminates immediately; the COBOL system cannot clean up file buffers or free system resources; this could lead to data file corruption if any files are open.

Value 3 produces a snap shot core file when any run-time system error occurs. After writing out the core file the process continues as normal; for example, to display an RTS error message, and the COBOL system can clean up. For this reason value 3 is usually the best choice.

Here is example syntax within the run-time configuration file, which must be pointed to by the COBCONFIG_ (Windows) or COBCONFIG (UNIX) environment variable:

set core_on_error=3
set core_filename="core.%f_%p@%t_%d"

As described in the documentation in the area of core_on_error, value 3 will work on AIX only when the "full core" kernel tunable is set. To enable "full core" support, run the following command as root on AIX:

chdev -l sys0 -a fullcore='true'

Problem:

On AIX, having set core_on_error, you may not know in what directory to expect the core file to appear. How can a person discover the directory where the core file will be written, and how can a person specify the directory of their choice?

Solution

Here is the command to display the current AIX core settings:

lscore

Here is the command to change the default location for core dump files:

chcore

For complete details, see the "man" pages on AIX, for both these commands "lscore" and "chcore".

For chcore, you would use "-p on" to indicate that you wanted to change the path, and you would specify the path with "-l <path>".

The chcore command can also possibly change the core file naming conventions if you like.

The command must be run with root privileges. You can make the changes system-wide, or just for a particular user. If you set it for a user, the user must log out then back in for the change to take effect.

To affect Enterprise Server cassi processes, the region must be stopped then re-started.


#EnterpriseDeveloper
#MFDS