on WSL systemd status fails output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Committed
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Critical
|
Unassigned |
Bug Description
[Impact]
WSL 24.04 / systemd 255.4-1ubuntu8
* Upstream report: https:/
* Upstream PR: https:/
* Upstream commit: https:/
In WSL, the cgroup.procs PID list for some reason contain a ton of zeros everywhere from unmapped PIDs.
Whenever cg_read_pid encounters such a zero, it throws an error. This makes systemd near unusable inside of WSL.
[Test Plan]
On WSL running Ubuntu 24.04, run systemctl status. On an affected system, there will be an error saying "Failed to dump process list [...]". On a patched system, the command should work as expected.
[Where problems could occur]
This patch adds a flags parameter to cg_read_pid(), and adds a new flag, CGROUP_
There are several places where cg_read_pid() is called in systemd, so there are several places where this would come up. If we did see problems, it would likely because a caller is skipping the unmapped pids when it should not be. For callers that do not skip (i.e. pass CGROUP_
[Original Description]
WSL 24.04 / systemd 255.4-1ubuntu8
* Upstream report: https:/
* Upstream PR: https:/
* Upstream commit: https:/
In WSL, the cgroup.procs PID list for some reason contain a ton of zeros everywhere from unmapped PIDs.
Whenever cg_read_pid encounters such a zero, it throws an error. This makes systemd near unusable inside of WSL.
# Test Case
install Ubuntu WSL 24.04 from the MS STore. This version has systemd already enabled.
## Expected Behavior
systemctl status command to work
## Actual Behavior
toor@XPS:~$ systemctl status
Failed to dump process list for 'XPS', ignoring: Input/output error
● XPS
State: degraded
Units: 318 loaded (incl. loaded aliases)
Jobs: 0 queued
Failed: 1 units
Since: Sat 2022-09-24 08:43:15 PDT; 14min ago
systemd: 251.4-1ubuntu6
Tainted: cgroupsv1
CGroup: /
upstream patch