To create a core dump

Note: (applies to Windows environments only)
  • You cannot enable both Just-In-Time Debugging and Core Dump concurrently.
  • To debug a 64-bit core dump you must first ensure the project is being built for 64-bit, by opening the Project Properties and selecting 64-bit.
  • To create a core dump for an application running under IIS, the application must be run in the same user account as that being used when enabling the core dump feature. For example, a core dump will not be produced for a CGI or ISAPI application running under the default anonymous logon account.

Unless your application programmatically generates a core dump, by calling the CBL_CREATE_CORE library routine, you must use run-time tunables to produce one.

  1. Create a run-time tunables file; see Format of a Configuration File for Native COBOL.
  2. Within the file, include the core_on_error tunable. By default, when a core dump occurs, it is saved with the name cblcore (Windows), or core or core.<pid> (UNIX), but you can change this by also including the core_filename tunable. For example:
    set core_on_error=3
    set core_filename="coredumptest.%p%t_%d"
    core_on_error parameters
    0 The run-time system never produces a core file on any signal (UNIX), or exception (Windows) or run-time system error. This is the default behavior of the run-time system.
    1 The run-time system produces a core file when any system signal (UNIX), or exception (Windows) is received that would normally produce a core file on the host system; for example, SIGBUS and SIGSEGV (which would usually produce a run-time system error 114). After writing out the core file the process terminates immediately.; for example, a run-time system error COBRT114, and so on.
    Warning: (UNIX platforms only) When this value is set, operating system security may prevent a core dump file from being created; refer to Preparing for a Core Dump for instructions on how to ensure that a core dump file is created.
    2 The run-time system produces a core file when any run-time system error occurs. After writing out the core file the process terminates immediately.
    Warning: (UNIX platforms only) When this value is set, operating system security may prevent a core dump file from being created; refer to Preparing for a Core Dump for instructions on how to ensure that a core dump file is created.
    3 The run-time system 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.
    129 Same as core_on_error=1, except no message box is displayed after the core file is created.
    130 Same as core_on_error=2, except no message box is displayed after the core file is created.
    131 Same as core_on_error=3, except no message box is displayed after the core file is created.
    core_filename parameters
    Important: You can only use this tunable when core_on_error is set to 3.
    path&filename The path and name of the file that will be produced when a core file is generated if you set the core_on_error tunable to the value 3. If filename contains a tunable string it is substituted as follows:
    %%
    Single %
    %d
    The date of when the program encountered the error, in the format yyyymmdd
    %f
    The basename of the program that encountered the error
    %p
    The process ID of the program that has encountered the error
    %t
    The time of when the program encountered the error, in the format hhmmss
  3. Set the COBCONFIG environment variable to the location of the tunables file. If you are running the application from your Eclipse project, you can set this in your project's Properties dialog box by selecting Micro Focus > Run-time Configuration > Environment Variables, and clicking Add.
  4. Run the application for which you are expecting a core dump file. When the run-time system receives an unhandled signal, a core dump file in created in the same directory as the application.