Bug#1153800: systemd: sd-event can block forever after ratelimit expiry
Xinlong Chen
xinlongchen01 at gmail.com
Thu Nov 12 07:04:05 GMT 2026
Package: systemd
Version: 257.13-1~deb13u1
Severity: important
Tags: upstream
systemd's sd-event loop can ignore already-pending event sources after a
ratelimit expiry callback and then block forever in epoll_wait(). PID 1 can
hit this through its mount event source and hang in the initrd.
This is fixed upstream by 1a60b10de9e4 ("sd-event: fix hang after ratelimit
expiry"):
https://github.com/systemd/systemd/commit/1a60b10de9e4a3fe59a2efa3c6a58fd72c305807
https://github.com/systemd/systemd/issues/44107
The fix is not present on the v252-stable or v257-stable branches. Both
current Debian packages reproduce it deterministically:
- bookworm: systemd 252.39-1~deb12u2
- trixie: systemd 257.13-1~deb13u1
Reproducer from the upstream issue, using only the public libsystemd API:
$ apt-get install gcc pkg-config libsystemd-dev
$ gcc -O2 -o repro repro.c $(pkg-config --cflags --libs libsystemd)
$ ./repro
HANG: sd_event_run() blocks although a defer source is pending
A fixed build prints "OK: defer source dispatched" and exits 0.
Workaround for PID 1: set SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST=0 on the
kernel command line or through ManagerEnvironment= in the initrd.
More information about the Pkg-systemd-maintainers
mailing list