]> git.ipfire.org Git - thirdparty/systemd.git/commit
machine: GC machine when no leader PID is set
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 28 Dec 2024 02:38:24 +0000 (11:38 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 28 Dec 2024 12:03:20 +0000 (12:03 +0000)
commit51a0a3b0494d01c1622f6d0c3e2c31e01c18612f
tree78b58de05169e78a3bdbbe1183315f07a7b968b0
parent8bc4a6e5cdb8c9d35e2bad88bb932875117ea019
machine: GC machine when no leader PID is set

After d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4, if a serialized
leader PID of a machine is already dead when deserialized, then the
leader PID and PIDFD are unset for the machine, and subsequent
machine_start() -> machine_watch_pidfd() will trigger an assertion.
This makes a Machine object without leader PID GCed.

Fixes a bug introduced by the combination of
d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4 (v255) and
1762c2c045d3a78d3cad54c6b1e5ee9624b32b00 (v257).

Fixes #35602.
src/machine/machine.c