Enabling core dumps v16
You can use core dumps to diagnose or debug errors. A core dump is a file containing a process's address space (memory) when the process terminates unexpectedly. Core dumps can be produced on demand, such as by a debugger, or upon termination.
Enabling core dumps on a RHEL or Rocky Linux or AlmaLinux host
On RHEL/Rocky Linux/AlmaLinux 8.x | 9.x, core file creation is disabled by default. To enable the core file generation:
Identify the system's current limit using the
ulimit -c
orulimit -a
command.0
indicates that core file generation is disabled.Create a directory to store the core dumps, and modify
kernel.core_pattern
to store the dumps in a specified directory:Persist the
kernel.core_pattern
setting across reboots:Enable core dumps in
/etc/security/limits.conf
to allow a user to create core files. Each line describes a limit for a user in the following form:Use
*
to enable the core dump size to unlimited.Set the limit of core file size to
UNLIMITED
:To set a core limit for the services, add the following setting in
/usr/lib/systemd/system/edb-as-16.service
:Reload the service configuration:
Modify the global default limit using systemd. Add the following setting in
/etc/systemd/system.conf
:Restart systemd:
Stop and then start EDB Postgres Advanced Server:
Now, the core dumps are enabled. Install the gdb tool and debug packages:
Replace the path to a core dump file. Then, get a backtrace using the
bt
command to analyze output:
Enabling core dumps on a Debian or Ubuntu host
On Debian 11 or Ubuntu 22, core file creation is disabled by default. To enable the core file generation:
Identify the system's current limit using the
ulimit -c
orulimit -a
command.0
indicates that core file generation is disabled.Create a new directory to store the core dumps, and modify
kernel.core_pattern
to store the dumps in a specified directory:Persist the
kernel.core_pattern
setting across reboots:To allow a user to create core files, enable core dumps in
/etc/security/limits.conf
. Each line describes a limit for a user in the following form.Use
*
to enable the core dump size to unlimited.Set the limit of core file size to
UNLIMITED
:To set a core limit for the services, add the following setting in
/lib/systemd/system/edb-as@.service
:Reload the service configuration:
Modify the global default limit using systemd. Add the following setting in
/etc/systemd/system.conf
:Restart systemd:
Stop and then start EDB Postgres Advanced Server:
Now, the core dumps are enabled. Install the gdb tool and debug symbols:
Replace the path to a core dump file. Then get a backtrace using the
bt
command to analyze output:
Note
- The debug info packages name on a Debian or Ubuntu host can vary and include a
-dbgsym
or-dbg
suffix. For more information about settingsources.list
and installing the debug info packages, see the Debian wiki or the Ubuntu wiki. - The core files can be huge, depending on the memory usage. Enabling the core dumps on a system might fill up its mass storage over time.