Hi,

[email protected] wrote:

> On Windows WSL2 (1.2.5.0) running Ubuntu 22.04.3 LTS one test failed.
> I downloaded a source release (coreutils-9.3) and did: ./configure,
> make, make check.
> 
> ============================================================================
> Testsuite summary for GNU coreutils 9.3
> ============================================================================
> # TOTAL: 643
> # PASS:  526
> # SKIP:  116
> # XFAIL: 0
> # FAIL:  1
> # XPASS: 0
> # ERROR: 0
> ============================================================================
> See ./tests/test-suite.log
> Please report to bug-coreutils <at> gnu.org
> ============================================================================
> [test-result.log snipped ...]

Thanks for sharing all of that information.

The /init mount point is an implementation detail for WSL2. From
skimming Microsoft's article [1], it seems like it receives the requests
to start Linux and Windows processes, handling them accordingly.

The issue is that this file is listed as rootfs in /proc/self/mountinfo,
but statfs reports it as tmpfs:

    $ grep --perl-regexp '\s+/init\s+' /proc/self/mountinfo /etc/mtab 
    /proc/self/mountinfo:111 82 0:2 /init /init ro - rootfs rootfs 
rw,size=1982392k,nr_inodes=495598
    /etc/mtab:rootfs /init rootfs ro,size=1982392k,nr_inodes=495598 0 0
    $ stat --file-system --format %T /init 
    tmpfs

I'm inclined to leave 'df' as is, since the only way to detect whether
we are WSL is through heuristics which may change in future WSL
versions.

I've attached a patch to skip the test. Pádraig, okay to push or shall
I wait until after release?

Collin

[1] 
https://learn.microsoft.com/en-us/archive/blogs/wsl/windows-and-ubuntu-interoperability#launching-processes-in-wsl


>From 5683e140eacc877b565a4fbad634ce31b5a602fb Mon Sep 17 00:00:00 2001
Message-ID: <5683e140eacc877b565a4fbad634ce31b5a602fb.1788748475.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sun, 6 Sep 2026 19:11:18 -0700
Subject: [PATCH] tests: df: skip a test on WSL

* tests/df/skip-rootfs.sh: Test for /init which is listed as rootfs in
/proc/self/mountinfo, but tmpfs according to statfs.
Fixes https://bugs.gnu.org/65331
---
 tests/df/skip-rootfs.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/df/skip-rootfs.sh b/tests/df/skip-rootfs.sh
index 1cca54700..5a1e037ef 100755
--- a/tests/df/skip-rootfs.sh
+++ b/tests/df/skip-rootfs.sh
@@ -30,6 +30,8 @@ DF_a() { df -a -x fuse.portal "$@"; }
 # rather than /proc/mounts.  I.e., when libmount is being used.
 DF_a >out || fail=1
 grep '^rootfs' out || skip_ 'no rootfs in mtab'
+{ grep '^rootfs .* /init' out && test $(stat -f -c %T /init) = tmpfs; } &&
+  skip_ 'test not compatible with WSL'
 
 # Ensure that rootfs is suppressed when no options is specified.
 df >out || fail=1
-- 
2.55.0

Reply via email to