Skip to content

stat: fix mount table read when /proc is unavailable#10300

Merged
ChrisDryden merged 3 commits intouutils:mainfrom
sylvestre:stat-mount
Feb 12, 2026
Merged

stat: fix mount table read when /proc is unavailable#10300
ChrisDryden merged 3 commits intouutils:mainfrom
sylvestre:stat-mount

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

Only read mount information when needed (%m directive) and handle gracefully when /proc/self/mountinfo is not accessible, fixing stat failures in chroot environments without /proc mounted.

see https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2133797

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)


let mount_list = self.mount_list.get_or_init(|| {
// Try to populate mount list, but don't fail if we can't
Self::populate_mount_list().ok()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we don't fail it appears that the GNU implementation provides a warning:

sudo unshare --mount sh -c 'mount -t tmpfs none /proc; stat --format="%m" /tmp'

I'm getting: "stat: cannot read table of mounted file systems: No such file or directory"

Only read mount information when needed (%m directive) and handle
gracefully when /proc/self/mountinfo is not accessible, fixing
stat failures in chroot environments without /proc mounted.

see https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2133797
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.

@ChrisDryden
Copy link
Copy Markdown
Collaborator

Just waiting on the CI but LGTM

@ChrisDryden ChrisDryden merged commit 8d8e7f8 into uutils:main Feb 12, 2026
154 of 155 checks passed
abendrothj pushed a commit to abendrothj/coreutils that referenced this pull request Feb 17, 2026
Only read mount information when needed (%m directive) and handle
gracefully when /proc/self/mountinfo is not accessible, fixing
stat failures in chroot environments without /proc mounted.

see https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2133797

Co-authored-by: Chris Dryden <christopher.paul.dryden@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants