From Fedora Project Wiki

Enable coredumpctl by default

Summary

Enable coredumpctl by default. Core dumps will be stored in the system journal rather than created in the crashing process's current working directory by ABRT.

Owner

Current status

  • Targeted release: Fedora 26
  • Last updated: 2016-12-05
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

coredumpctl will be enabled by default. Core dumps will now be stored in the systemd journal, rather than created in the crashing process's current working directory by ABRT. Currently abrt-ccpp.service installs its own core pattern to /proc/sys/kernel/core_pattern that overrides the core pattern set by systemd. We will simply disable abrt-ccpp.service in the Fedora systemd presets to avoid this. This is of course only a change in default behavior. It will still be possible and easy to revert to the previous Fedora behavior by enabling and starting abrt-ccpp.service, or to traditional Linux behavior by overriding the sysctl variable kernel.core_pattern.

Note that coredumpctl is intended as a developer tool, not as an automatic bug reporting tool nor as a replacement for ABRT. ABRT will continue to automatically report C and C++ crashes to the Fedora Analysis Framework (FAF), and users will still be able to manually report crashes to Red Hat Bugzilla using ABRT's Problem Reporting application. Nor does coredumpctl replace ABRT's ability to catch non-C/C++ issues like Java exceptions, Python exceptions, or machine check events. ABRT remains an important component of Fedora, and will continue to function largely as before as it has support for retrieving core files from the system journal using abrt-vmcore.service. However, it must be admitted that ABRT's feature set will be slightly smaller with abrt-ccpp.service disabled. Notably, crash-time stacktraces will no longer be available as all stacktraces will be generated from core files extracted from the system journal. This could result in reduced-quality for the truncated stacktraces that are used in FAF and the first comment in Bugzilla, but it will not affect the detailed stacktraces that are uploaded as Bugzilla attachments.

Benefit to Fedora

Software developers who have used coredumpctl on other Linux distributions are often frustrated when it is not available or enabled. Working with core dumps manually can be annoying and is often considered primitive by developers who are familiar with core dumpctl. Enabling coredumpctl by default means we will have a better out-of-the-box developer experience than distributions that have not yet enabled this functionality. Developers who prefer to manually work with core dumps will still be able to revert to the previous behavior.

Scope

  • Proposal owners: We will disable abrt-ccpp.service in our systemd presets. That's it.
  • Other developers: We request some assistance from SELinux developers to address an incompatibility between SELinux and coredumpctl that was introduced in Fedora 24, RHBZ #1341829.
  • Policies and guidelines: No changes needed
  • Trademark approval: Not needed for this change

Upgrade/compatibility impact

Because this is a change of systemd preset, most users will automatically receive the new behavior. Users who wish to revert to previous Fedora behavior will need to manually enable and start abrt-ccpp.service. Users who have previously disabled abrt-ccpp.service will see no changes.

How To Test

Write some program that crashes (e.g. "int main() { ((void(*)())0)(); }"), then verify that you get a backtrace by running 'coredumpctl gdb'. Also verify that reporting crashes in Fedora applications with ABRT still works as expected: crashes should still be automatically reported to the retrace server, and it should still be possible to manually report to Red Hat Bugzilla using the installed ABRT GUI.

User Experience

Currently, obtaining a core dump from a crashing program requires manually changing the ulimit, executing the program until it crashes, and then opening the core dump in gdb. It is inconvenient to obtain a core dump if the program is an unpackaged system service/daemon. It is also very inconvenient if the crash is sporadic and not easy to reproduce. ABRT already handles these cases well as a bug reporting tool for system packages, and it is already able to handle crashes of unpackaged applications with some configuration changes, but it is not as convenient to use for development purposes as coredumpctl. For instance, simply running 'coredumpctl gdb' will automatically launch gdb and generate a stacktrace for the most recent crash that occured on the system.

coredumpctl is supported by the large systemd developer community and is quite mature. It rate-limits core dump generation and automatically removes old core dumps to save disk space. It stores short truncated stacktraces in the journal indefinitely, even after the associated core dump has been removed.

Dependencies

Packages that depend on systemd should not be directly affected by this change.

Unfortunately Fedora 24 introduced an incompatibility between SELinux and coredumpctl that remains unfixed: bug #1341829. We will not be able to ship this feature until this SELinux bug is fixed as it would result in us losing all automatic bug reports in the meantime. We request assistance from the SELinux developers to address this bug.

Contingency Plan

  • Contingency mechanism: The contingency mechanism is to simply revert the systemd preset so that abrt-ccpp.service is once again enabled by default.
  • Contingency deadline: Beta freeze
  • Blocks release? No
  • Blocks product? No

Documentation

coredumpctl is well-documented in manpages. Refer to coredumpctl(1), systemd-core dump(8), or coredump.conf(5).

Release Notes

By default, core dumps from crashing programs are now stored in the system journal, rather than created in the crashing process's current working directory by ABRT. They may be extracted using the coredumpctl tool. For example, simply run 'coredumpctl gdb' to view a backtrace for the most recent crash in gdb. For more information on this change, refer to the manpages coredumpctl(1), systemd-core dump(8), and coredump.conf(5).