Core Dumps

Describes how to generate core dumps using run-time tunables and by using the CBL_CREATE_CORE library routine.

When an application crashes or when you programmatically invoke a core dump, you can arrange for the application state to be saved to a core file, which contains source code error details including the contents of memory at the time of the error, and the values of any variables and expressions set at the time. You can then use the core file to help debug any problems.

By default, core dumps are not created for run-time errors. For example, by default, if the operating system detects a memory access violation caused by your application, no dump is produced. You must configure the system to produce a dump for these situations.

Once you have produced a core dump, you can debug the core dump to help determine the cause of the error. See Debugging Using a Core Dump for details.

You can use either of these options to create a run-time core dump:

CBL_CREATE_CORE library routine
The CBL_CREATE_CORE library routine enables a COBOL program to invoke a core dump on demand, that is, without encountering a run-time error. You simply add a call to CBL_CREATE_CORE to your program at the point where you want the dump to take place.
core_on_error and core_filename run-time tunables
This option enables you to configure the COBOL run time to automatically produce a core dump when an application fails.
Notes:
  • The functionality does not identify memory corruption issues. You can use it to identify application problems only.
  • This only shows the line of failure if the failing module was compiled for debug before the core was generated.
  • For applications the run on Enterprise Server, you can configure your enterprise server instance to create a core dump. See To configure an enterprise server instance to produce a core dump for details.