Skip to content

fstatat errors printed to console when entering input #9550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahupp opened this issue Feb 6, 2023 · 4 comments
Closed

fstatat errors printed to console when entering input #9550

ahupp opened this issue Feb 6, 2023 · 4 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@ahupp
Copy link

ahupp commented Feb 6, 2023

environment info:

$ fish --version
fish, version 3.6.0
$ echo $version
3.6.0
$ uname -a
Linux framework 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

The problem occurs when running under "sh -c 'env HOME=$(mktemp -d) fish'", as well as "env -i fish --login --no-config"

details

When entering a command in fish, I'll see error output on each keypress like the following:

❯ firfstatat: No such device
e     fstatat: No such device
f      fstatat: No such device
o       fstatat: No such device
x        fstatat: No such device

This starts after a few keypresses, and ends after I've typed something that is found in the PATH. strace tells me that the failing call is:

[pid 413938] newfstatat(8, "gdrive", 0x7f17df4e0980, 0) = -1 ENODEV (No such device)

~/gdrive is a symlink to a mounted but somehow messed up mount point, using the WSL drvfs filesystem that gives access to Windows drives into WSL. This is specifically a Google Drive virtual drive:

$ ls -l
...
lrwxrwxrwx   16 adam 12 Dec  2021 gdrive -> /mnt/g/My Drive/
$ mount | grep /mnt/g
drvfs on /mnt/g type 9p (rw,relatime,dirsync,aname=drvfs;path=g:;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)

If I delete the symlink, or re-mount the bad mountpoint the errors stop.

what should happen instead?

I'm not sure why ~/gdrive is being accessed at all, since it's not mentioned in my fish config or environment. So two suggestions:

  1. Whatever is accessing ~/gdrive may not be necessary and could be avoided entirely
  2. If a necessary feature does trigger this kind of error, a more descriptive message would be helpful.
@faho faho added the bug Something that's not working as intended label Feb 6, 2023
@faho faho added this to the fish 3.6.1 milestone Feb 6, 2023
@faho
Copy link
Member

faho commented Feb 6, 2023

Is ~/gdrive in your $CDPATH or your $PATH?

Whatever is accessing ~/gdrive may not be necessary and could be avoided entirely

If it is in your $PATH or $CDPATH, then accessing it is in fact necessary.

If a necessary feature does trigger this kind of error, a more descriptive message would be helpful.

The error spew shouldn't happen, sure. But this filesystem is also broken - ENODEV is not documented to be returned for fstatat. So, because this error isn't expected, we can't really explain it any better other than just show the standard error message.

I'm gonna silence this and send you on your way.

@faho faho closed this as completed in e90f003 Feb 6, 2023
@ahupp
Copy link
Author

ahupp commented Feb 6, 2023

@faho ~/gdrive is not in $PATH or $CDPATH, nor the fish config:

$ env | grep gdrive
$ cd .config/fish/
$ rg gdrive
$

@faho
Copy link
Member

faho commented Feb 6, 2023

In that case I'm assuming autosuggestion thought it was a cromulent path.

In any case the error should be silent now.

@ahupp
Copy link
Author

ahupp commented Feb 6, 2023

ty!

zanchey pushed a commit that referenced this issue Feb 27, 2023
Some broken gdrive filesystem can return these.

Fixes #9550

(cherry picked from commit e90f003)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants