-
Notifications
You must be signed in to change notification settings - Fork 356
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
Miri should warn or error when accessing file at /proc/self/fd/X
#4096
Comments
Miri virtualizes file descriptors, so the FD number you see may have nothing to do with the FD numbers in So I am inclined to close this as not-a-bug; we don't support bypassing Miri and directly accessing the underlying OS. You will run into similar issues trying to access |
Is there a general guideline about what Linux features Miri emulates (or wants to emulate) and which ones it doesn't? For example Miri is emulating Linux file descriptor handles (and I'm guessing some syscalls), but is not emulating I think it sounds fine to not support On the other hand, I believe that some glibc functions read from files in |
Miri doesn't run glibc. Instead it emulates the api surface exposed by glibc, so any accesses to |
Generally we throw an error when you hit something we can't emulate. But we didn't consider the interactions with |
/proc/self/fd/X
/proc/self/fd/X
That should be fairly easy to do: in the code for |
Actually should reading from symlink works in miri? I realised most of the stuff in If it doesn't, maybe we can throw an error when it tries to read from symlink. I slightly looked into this, this seems to be the place where miri hangs: Lines 33 to 49 in b9a24fc
and |
Symlinks are fine. It will just read through them transparently. |
If your program attempts to open and read from a file in
/proc/self/fd/
, thencargo miri run
(with isolation disabled) hangs.This is also reproducible at:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d05155bb1f3c7aff5e705b0e2904d21c
I'm guessing that miri virtualizes filesystem operations in some way, and maybe files in
/proc
just aren't supported?The text was updated successfully, but these errors were encountered: