Enabling core dumps v15
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 may be produced on-demand (such as by a debugger) or automatically upon termination.
Enabling core dumps on a RHEL or CentOS or Rocky Linux or AlmaLinux host
On RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x, core file creation is disabled by default. To enable the core file generation, follow the following commands:
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:Use the following command to 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
by using the following command:To set a core limit for the services, add the following setting in
/usr/lib/systemd/system/edb-as-15.service
:Reload the service configuration:
Modify the global default limit using
systemd
, add the following setting in/etc/systemd/system.conf
:Restart the
systemd
:Stop and then start EDB Postgres Advanced Server:
Now, the core dumps are enabled, install the
gdb
tool and debug packages using the following command:Replace the path to a core dump file before proceeding to get a backtrace using the
bt
command to analyze output:
Enabling core dumps on a Debian or Ubuntu host
On Debian 10 or Ubuntu 18, 20, core file creation is disabled by default. To enable the core file generation, follow the following commands:
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:Use the following command to 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
by using the following command: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 the
systemd
:Stop and then start EDB Postgres Advanced Server:
Now, the core dumps are enabled, install the
gdb
tool and debug symbols using the following command:Replace the path to a core dump file before proceeding to get a backtrace using the
bt
command to analyze output:
Note
- The debug info packages name on a Debian or Ubuntu host may vary and include
-dbgsym
or-dbg
suffix. For more information about settingsources.list
and installing the debug info packages, visit Debian or Ubuntu wiki at https://wiki.debian.org/HowToGetABacktrace or https://wiki.ubuntu.com/Debug%20Symbol%20Packages respectively. - The core files can be huge depending on the memory usage, enabling the core dumps on a system may fill up its mass storage over time.