1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00
The systemd System and Service Manager
Go to file
Zbigniew Jędrzejewski-Szmek 92e92d71fa coredump: process special crashes in an (almost) normal way
We would only log a terse message when pid1 or systemd-journald crashed.
It seems better to reuse the normal code paths as much as possible,
with the following differences:
- if pid1 crashes, we cannot launch the helper, so we don't analyze the
 coredump, just write it to file directly from the helper invoked by the
 kernel;
- if journald crashes, we can produce the backtrace, but we don't log full
  structured messages.

With comparison to previous code, advantages are:
- we go through most of the steps, so for example vacuuming is performed,
- we gather and log more data. In particular for journald and pid1 crashes we
  generate a backtrace, and for pid1 crashes we record the metadata (fdinfo,
  maps, etc.),
- coredumpctl shows pid1 crashes.

A disavantage (inefficiency) is that we gather metadata for journald crashes
which is then ignored because _TRANSPORT=kernel does not support structued
messages.

Messages for the systemd-journald "crash" have _TRANSPORT=kernel, and
_TRANSPORT=journal for the pid1 "crash".

Feb 26 16:27:55 systemd[1]: systemd-journald.service: Main process exited, code=dumped, status=11/SEGV
Feb 26 16:27:55 systemd[1]: systemd-journald.service: Unit entered failed state.
Feb 26 16:37:54 systemd-coredump[18801]: Process 18729 (systemd-journal) of user 0 dumped core.
Feb 26 16:37:54 systemd-coredump[18801]: Coredump diverted to /var/lib/systemd/coredump/core.systemd-journal.0.36c14bf3c6ce4c38914f441038990979.18729.1488145074000000.lz4
Feb 26 16:37:54 systemd-coredump[18801]: Stack trace of thread 18729:
Feb 26 16:37:54 systemd-coredump[18801]: #0  0x00007f46d6a06b8d fsync (libpthread.so.0)
Feb 26 16:37:54 systemd-coredump[18801]: #1  0x00007f46d71bfc47 journal_file_set_online (libsystemd-shared-233.so)
Feb 26 16:37:54 systemd-coredump[18801]: #2  0x00007f46d71c1c31 journal_file_append_object (libsystemd-shared-233.so)
Feb 26 16:37:54 systemd-coredump[18801]: #3  0x00007f46d71c3405 journal_file_append_data (libsystemd-shared-233.so)
Feb 26 16:37:54 systemd-coredump[18801]: #4  0x00007f46d71c4b7c journal_file_append_entry (libsystemd-shared-233.so)
Feb 26 16:37:54 systemd-coredump[18801]: #5  0x00005577688cf056 write_to_journal (systemd-journald)
Feb 26 16:37:54 systemd-coredump[18801]: #6  0x00005577688d2e98 dispatch_message_real (systemd-journald)
Feb 26 16:37:54 kernel: systemd-coredum: 9 output lines suppressed due to ratelimiting
Feb 26 16:37:54 systemd-journald[18810]: Journal started

Feb 26 16:50:59 systemd-coredump[19229]: Due to PID 1 having crashed coredump collection will now be turned off.
Feb 26 16:51:00 systemd[1]: Caught <SEGV>, dumped core as pid 19228.
Feb 26 16:51:00 systemd[1]: Freezing execution.
Feb 26 16:51:00 systemd-coredump[19229]: Process 19228 (systemd) of user 0 dumped core.

                                         Stack trace of thread 19228:
                                         #0  0x00007fab82075c47 kill (libc.so.6)
                                         #1  0x000055fdf7c38b6b crash (systemd)
                                         #2  0x00007fab824175c0 __restore_rt (libpthread.so.0)
                                         #3  0x00007fab82148573 epoll_wait (libc.so.6)
                                         #4  0x00007fab8366f84a sd_event_wait (libsystemd-shared-233.so)
                                         #5  0x00007fab836701de sd_event_run (libsystemd-shared-233.so)
                                         #6  0x000055fdf7c4a380 manager_loop (systemd)
                                         #7  0x000055fdf7c402c2 main (systemd)
                                         #8  0x00007fab82060401 __libc_start_main (libc.so.6)
                                         #9  0x000055fdf7c3818a _start (systemd)

Poor machine ;)
2017-02-28 21:33:52 -05:00
.github CONTRIBUTING: reword the part about unsetting the label (#4716) 2016-11-23 08:52:19 +01:00
.mkosi Merge pull request #4879 from poettering/systemd 2017-01-14 21:29:27 -05:00
catalog catalog: use https:// in URLs 2017-02-21 18:21:13 +01:00
coccinelle tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
docs docs: use https:// in URLs 2017-02-21 18:18:24 +01:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb Added hwdb rule for E5570 laptop (PointingStick) 2017-02-22 12:57:21 +03:00
m4 build-sys: Perform flag tests in context to existing flags 2016-02-06 14:57:46 +01:00
man coredumpctl,man: mark truncated messages as such in output 2017-02-26 19:45:10 -05:00
network network: allow LLDP packets to cross non-customer bridges for container network interfaces 2016-05-09 15:45:31 +02:00
po l10n: fix file permissions of Indonesian translation 2017-02-07 19:02:01 +01:00
rules Export NVMe WWID udev attribute (#5348) 2017-02-17 08:46:06 +01:00
shell-completion shell-completion: include the new coredumpctl options 2017-02-24 21:30:59 +02:00
src coredump: process special crashes in an (almost) normal way 2017-02-28 21:33:52 -05:00
sysctl.d sysctl.d: replace URL of SysRq key documentation (#5274) 2017-02-08 19:42:43 +01:00
system-preset unit: drop console-shell.service (#4298) (#4325) 2016-10-10 12:06:26 +02:00
sysusers.d remove bus-proxyd 2016-02-12 19:10:01 +01:00
test test-journal-importer: add a test case with broken input 2017-02-15 00:31:55 -05:00
tmpfiles.d tmpfiles.d: set primary group rights to r-w (#5265) 2017-02-07 18:56:55 -05:00
tools tools/catalog-report.py: a script to scour the journal for bad catalog entries 2016-12-11 15:43:16 -05:00
units units: order systemd-nspawn@.service after systemd-resolved.service 2017-02-17 16:06:31 -05:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el editors: only extend line width to 119 for C and XML files 2016-02-10 12:29:32 +01:00
.editorconfig editors: only extend line width to 119 for C and XML files 2016-02-10 12:29:32 +01:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore Merge pull request #5131 from keszybz/environment-generators 2017-02-21 11:11:44 +01:00
.mailmap start putting together a NEWS entry for 233 2017-02-21 13:59:23 +01:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: fix indentation logic for our docbook xml files 2016-04-29 12:23:34 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
autogen.sh build-sys/autogen: don't use bashisms (#4489) 2016-10-25 19:39:48 -04:00
CODING_STYLE tree-wide: set SA_RESTART for signal handlers we install 2016-12-01 12:41:17 +01:00
configure.ac Merge pull request #4670 from htejun/systemd-controller-on-unified-v2 2017-02-23 16:23:02 +01:00
DISTRO_PORTING It's now ok to use Google NTP servers (#5311) 2017-02-12 00:30:40 -05:00
ENVIRONMENT.md Rename $TEST_DIR to $SYSTEMD_TEST_DATA, document it 2017-02-16 21:36:31 +01:00
HACKING HACKING: mkosi is now packaged for Fedora 2017-02-14 23:56:48 -05:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile-man.am Merge pull request #5131 from keszybz/environment-generators 2017-02-21 11:11:44 +01:00
Makefile.am Revert "udev: Introduce UDEV_PROPAGATE_LOG macro (#5302)" 2017-02-23 12:36:25 +01:00
mkosi.build mkosi: change /etc/issue text a bit for mkosi images build from systemd tree 2016-12-14 18:29:30 +01:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
NEWS NEWS: fix typo (#5453) 2017-02-25 09:19:26 -05:00
README NEWS, README: use www prefix in freedesktop.org URLs 2017-02-21 18:26:23 +01:00
README.md README, README.md: use https:// in URLs 2017-02-21 15:56:04 +01:00
TODO Merge pull request #4962 from poettering/root-directory-2 2017-02-08 23:05:05 -05:00

systemd - System and Service Manager

Build Status
Coverity Scan Status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements are provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the HACKING file for information how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.