assert_signal_internal() returns 0 in two distinct cases: 1. In the child process (immediately after fork returns 0). 2. In the parent process, if the child exited normally (no signal). ASSERT_SIGNAL fails to distinguish these cases. When a child exited normally (case 2), the parent process receives 0, incorrectly interprets it as meaning it is the child, and re-executes the test expression inside the parent process. Goodness gracious! This causes two severe test integrity issues: 1. False positives. The parent can run the expression, succeed, and call _exit(EXIT_SUCCESS), causing the test to pass even though no signal was raised. 2. Silent truncation. The _exit() call in the parent terminates the test runner prematurely, preventing subsequent tests in the same file from running. Example of the bug in action, from #39674: ASSERT_SIGNAL(fd_is_writable(closed_fd), SIGABRT) This test should fail (fd_is_writable does not SIGABRT here), but with the bug, the parent hallucinated being the child, re-ran the expression successfully, and exited with success. Fix this by refactoring assert_signal_internal() to be much more strict about separating control flow from data. The signal status is now returned via a strictly typed output parameter, guaranteeing that determining whether we are the child is never conflated with whether the child exited cleanly.
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on 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, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS
