How do I enable core dumps on Red Hat Enterprise Linux?

A core dump is a on disk representation of a state of a user space application at the time of its abnormal termination. Core dumps can be used to diagnose the cause of a crash of an application.

Core dumps are not useful to end users, as they require specialised skills to analyze and determine the cause of the crash. In most cases, enabling a core dump is not necessary until there is a specific need.

In Red Hat Enterprise Linux, core file creation is disabled for interactive shells. This is configured in the /etc/profile by theulimit command.

The /etc/profile contains system wide environment variables and commands that will be run for any interactive shell. By default, it contains this line:

ulimit -S -c 0 > /dev/null 2>1

To enable core dumps for interactive or non-daemon programs, change this line to:

ulimit -S -c unlimited  >/dev/null 2>1

This will allow all users to produce core files with no upper size limit.