[Bug 2067922] Re: on WSL systemd status fails output

Jean-Baptiste Lallement 2067922 at bugs.launchpad.net
Mon Jul 8 08:44:40 UTC 2024


I've been able to reproduce the problem on Ubuntu WSL 24.04 with systemd 255.4-1ubuntu8.1. 
I verified that version 255.4-1ubuntu8.2 fixes it.


u at drenec:~$ systemctl status
● drenec
    State: running
    Units: 359 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2024-07-08 09:41:07 CEST; 1h 1min ago
  systemd: 255.4-1ubuntu8.2
  Tainted: cgroupsv1
   CGroup: /
           ├─init.scope
           │ ├─  1 /sbin/init
           │ ├─  2 /init
           │ ├─  6 plan9 --control-socket 6 --log-level 4 --server-fd 7 --pipe-fd 9 --log-truncate
           │ ├─325 /init
           │ ├─326 /init
           │ ├─327 -bash
           │ ├─546 systemctl status
           │ └─547 less

Marking as verification-done.

** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2067922

Title:
  on WSL systemd status fails output

Status in systemd package in Ubuntu:
  Fix Committed
Status in systemd source package in Noble:
  Fix Committed

Bug description:
  [Impact]

  WSL 24.04 / systemd 255.4-1ubuntu8

  * Upstream report: https://github.com/microsoft/WSL/issues/8879
  * Upstream PR: https://github.com/systemd/systemd/pull/32534
  * Upstream commit: https://github.com/systemd/systemd-stable/commit/8e57759d6d80ef772d8e17a4559a6797e09af93a.patch

  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_DONT_SKIP_UNMAPPED. The new default behavior of
  cg_read_pid() is that unmapped pids *will* be skipped. When this flag
  is set in a call to cg_read_pid(), encountering an unmapped pid will
  leave the caller to deal with it.

  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_DONT_SKIP_UNMAPPED), they either handle it cleanly, or
  propagate a different error to signal this case.

  [Original Description]

  WSL 24.04 / systemd 255.4-1ubuntu8

  * Upstream report: https://github.com/microsoft/WSL/issues/8879
  * Upstream PR: https://github.com/systemd/systemd/pull/32534
  * Upstream commit: https://github.com/systemd/systemd-stable/commit/8e57759d6d80ef772d8e17a4559a6797e09af93a.patch

  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 at 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: /

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2067922/+subscriptions




More information about the foundations-bugs mailing list