Bug 2213176

Summary: [Regression] RHEL systemd disables coredumping by default
Product: Red Hat Enterprise Linux 9 Reporter: Renaud Métrich <rmetrich>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED MIGRATED QA Contact: Frantisek Sumsal <fsumsal>
Severity: high Docs Contact:
Priority: high    
Version: 9.2CC: qguo, systemd-maint-list
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 15:15:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2023-06-07 10:05:27 UTC
Description of problem:

I just found that /etc/systemd/system.conf was having this:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
DefaultLimitCORE=0:infinity
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Thanks to this "feature", we don't get any coredump when a service fails, which is not that optimal for our support work.
Please drop this patch, it's a regression compared to RHEL8.

Version-Release number of selected component (if applicable):

systemd-252

How reproducible:

Always

Steps to Reproduce:
1. Kill sshd with SEGV signal

  # kill -11 $(cat /run/sshd.pid)

Actual results:

No coredump created:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# journalctl -u systemd-coredump 
Jun 07 12:00:41 vm-uefi9 systemd[1]: Started Process Core Dump (PID 2859/UID 0).
Jun 07 12:00:41 vm-uefi9 systemd-coredump[2860]: Resource limits disable core dumping for process 782 (sshd).
Jun 07 12:00:41 vm-uefi9 systemd-coredump[2860]: [🡕] Process 782 (sshd) of user 0 dumped core.
Jun 07 12:00:41 vm-uefi9 systemd[1]: systemd-coredump: Deactivated successfully.

# coredumpctl
TIME                         PID UID GID SIG     COREFILE EXE            SIZE
Wed 2023-06-07 12:00:41 CEST 782   0   0 SIGSEGV none     /usr/sbin/sshd    -
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Expected results:

Coredump being created

Additional info:

RHEL8 behaviour is correct:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl show | grep CORE
DefaultLimitCORE=infinity
DefaultLimitCORESoft=infinity
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Being able to analyze core dumps is critical to RHEL Support.

Comment 1 Frantisek Sumsal 2023-06-07 10:16:13 UTC
The RHEL9 setting actually copies RHEL8 setting which, in turn, copies RHEL7 setting, e.g.:

# Relevant commit: https://github.com/redhat-plumbers/systemd-rhel9/commit/7b1eb758d1f87bfd98dbb8037a842ceedb245815
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.3 Beta (Plow)
# grep CORE /etc/systemd/system.conf
DefaultLimitCORE=0:infinity
# systemctl show | grep CORE
DefaultLimitCORE=infinity
DefaultLimitCORESoft=0
# ulimit -c
0

# Relevant commit: https://github.com/redhat-plumbers/systemd-rhel8/commit/e2f5e8ccb27f48717b50339f58582d70ad5f59b1
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.9 Beta (Ootpa)
# grep CORE /etc/systemd/system.conf
DefaultLimitCORE=0:infinity
# systemctl show | grep CORE
DefaultLimitCORE=infinity
DefaultLimitCORESoft=0
# ulimit -c
0

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 (Maipo)
# grep CORE /etc/systemd/system.conf 
#DefaultLimitCORE=
# systemctl show | grep CORE
DefaultLimitCORE=18446744073709551615
# ulimit -c
0

Comment 2 Frantisek Sumsal 2023-06-07 10:28:19 UTC
And just to reiterate on that - the fact that it was once set to a non-zero value, i.e. before [0], was a regression, the current behavior is expected.

[0] https://github.com/redhat-plumbers/systemd-rhel8/commit/830bd662276ee117e65a4b3d541f77e8b172eafd

Comment 3 RHEL Program Management 2023-09-21 13:54:42 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-21 15:15:08 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.