-
Notifications
You must be signed in to change notification settings - Fork 353
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
Can't call foreign function: clock_gettime #641
Comments
What value should it return? Always zero (makes timeout impossible), current time (not deterministic) or start with zero and increase every executed statement? |
Even starting with zero and incrementing with every call to |
Yeah, this is currently outside the range of what Miri is intended to support. We can't do I/O anyway so timeouts would hardly make much sense. |
Yeah but tokio is an important part of Rust ecosystem but it scares me a little bit with its TSAN suppressions file. I would like to have a opportunity to run Tokio tests with miri (even a subset of them). |
Sure it'd be great if we could run more things in Miri, just some things are much harder to get running than others. ;) Basically, for now the focus is on libraries that are platform-agnostic and do not need to access any but the most basic OS facilities. Even there we still have some gaps, such as the following program: fn main() {
let v: [Vec<i32>; 0] = [];
let c = v.concat();
assert_eq!(c, []);
} (This is an instance of #224.) Notice that Miri does not support concurrency, and if it did it'd likely not detect data races. So it is not a supplement for TSAN. Don't get me wrong, I'd love to make Miri test tokio. It's just a lot of work. Don't expect us to implement Does Tokio have a part of the test suite that can run without any I/O? Does that even make sense? That would be the kind of tests that I think you could hope to run in Miri. Another good idea might be to look at the infrastructure crates that tokio relies on, and test those. |
Can't miri execute these on host by |
Thanks! I will try! |
Besides the huge implementation complexity, that would also break cross-interpretaion -- currently Miri can execute MIR for any target on any host. |
Well, yes, this "semihosting" is supposed to be a separate limited mode, not something that would work on every program in any configuration. |
With #683 coming up to tackle #653, it might be time to reconsider this. My position is that we should have a flag like |
I don't know. cc @carllerche |
I think working on support libstd is an important steeping stone. |
#800 is actually ongoing and we do have With that flag set, letting the program access the clock seems fine. Someone just has to implement it. :) |
@RalfJung Cool! so I enabled |
Eh, the clock isn't implemented yet. So enabling communication won't make a difference for that.
Looks like you are doing file system access. That's a lot of shims that someone has to implement. See #923. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
test that build scripts do not run in Miri @elichai reported something that sounded a lot like build script running in Miri. But as this test shows, build scripts are not run by Miri, they are run normally. @elichai are you sure the [env var usage you were referring to](#641 (comment)) was only in a build script? Those shouldn't be affected by Miri flags at all. Is your code available somewhere so that I can try to reproduce?
test that build scripts do not run in Miri @elichai reported something that sounded a lot like build script running in Miri. But as this test shows, build scripts are not run by Miri, they are run normally. @elichai are you sure the [env var usage you were referring to](#641 (comment)) was only in a build script? Those shouldn't be affected by Miri flags at all. Is your code available somewhere so that I can try to reproduce?
test that build scripts do not run in Miri @elichai reported something that sounded a lot like build script running in Miri. But as this test shows, build scripts are not run by Miri, they are run normally. @elichai are you sure the [env var usage you were referring to](#641 (comment)) was only in a build script? Those shouldn't be affected by Miri flags at all. Is your code available somewhere so that I can try to reproduce?
the clock and file shims have already landed on unix and we already have an issue for the windows clock counterpart. I think we can mark this one as solved. Thoughts? |
How to reproduce:
The text was updated successfully, but these errors were encountered: