Preparing for a core dump

Security enhancements on Linux-based platforms may prevent a core dump from being generated when you are expecting one. If you are using the core_on_error=1, core_on_error=2, or signal_regime tunables, you need to perform the following steps to override the security, and then run the application from which you require the core dump. (If you are using core_on_error=3, a core dump file will always be created, regardless of this security enhancement; follow the details in To create a core dump instead.)

Note: The following commands must be run with root privileges.
  1. Disable any size limitations that could stop the core dump file from being created in its entirety:
    ulimit -c unlimited
  2. Specify the format and location in which the core dump is to be created - to create the core dump file in the format core.process-id, in the same directory as your application:
    echo "core.%p"> /proc/sys/kernel/core_pattern
    Note: This is only set for the current session; to ensure the format and location persists after a reboot, add the following line to your /etc/sysctl.conf configuration file:
    kernel.core_pattern=core.%p
  3. Disable the AppArmor application (SUSE platforms), or Automatic Bug Reporting Tool (Red Hat platforms) that is preventing the generation of a core dump file:

    SUSE:

    rcapparmor stop

    Red Hat:

    chkconfig abrt off
  4. Ensure that the core dump contains information resulting from processes that were granted permission via setuid and setgid:
    sysctl -w kernel.suid_dumpable=2
    Note: This permission override is only set for the current session; to ensure it persists after a reboot, add the following line to your /etc/sysctl.conf configuration file:
    kernel.suid_dumpable=2
  5. 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.