-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
no longer builds after rust-lang/rust#95624
#95627
Comments
#95035 makes this somewhat tricky, Miri will have to support more ways of using |
We support FUTEX_WAIT and FUTEX_WAKE, but not FUTEX_WAIT_BITSET. @m-ou-se what would you say is a good place to learn about futex semantics, ideally suitable as a reference documentation that one can follow if one wants to do a reimplementation in an interpreter? |
The man page for the Linux syscall is the best documentation/reference: https://man7.org/linux/man-pages/man2/futex.2.html FUTEX_WAIT_BITSET shouldn't be hard to implement. I can work on Miri support for it. :) |
That would be great. :) Best to start with |
This adds support for FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET in Miri: rust-lang/miri#2054 |
The next trouble is #95469 -- somehow this broke printing to stdout in Miri on Windows targets, which now just loops infinitely. @ChrisDenton any idea what might be going on? |
I made a quick summary in #95759 but still need to investigate properly. Short version is that in some cases we're passing asynchronous handles to child processes, which is unsound when read synchronously (but mostly seemed to work in practice). Though I'm not actually sure why that should make it loop infinitely since it's calling |
Note that this happens even on a Linux host interpreting Windows target MIR. So it might be a different problem?
|
The odd thing is, these tests do not even read/write a file (Miri does not support that on Windows targets). They just write to stderr/stdout.
If NtRead/WriteFile were ever executed, Miri would stop immediately since it does not support those operations.
|
Oh right! Hm... I'm not really sure why that be. The changes are limited to reading and writing from a handle. |
I had another look and as far I can tell there's no code path that doesn't call either Just to be clear, you're totally certain it was that PR that caused the issue? |
Yeah I bisected it to this PR in rust-lang/miri#2056. (I can double-check later.)
|
Then I'll admit to being stumped. 😕 |
Does the Windows stdout/stderr go through a "handle" or is it a separate code path? |
Ah, I did recently change piped stdout/stderr to use a loop (in #95467). But it also uses new functions to do that ( |
But Miri works fine on bbe9d27 which includes that PR... |
Oh, I think it's pretty simple -- It doesn't make a lot of sense for |
Oh! Sorry! I did that without even thinking and it didn't even occur to me look at that again. The fallback should probably just abort or return an error. I'll make a PR. |
Uff, that compat stuff is using some nasty things which Miri would all have to support. :/ Is there any chance these functions could be called like regular 'extern fn', without all that compat craziness? I doubt we are making stdin/stdout optional so for all intents and purposes those functions have to exist for Rust programs to run on Windows. |
The problem is these |
An alternative might be a hack like this: #95775. |
…isDenton make windows compat_fn (crudely) work on Miri With rust-lang#95469, Windows `compat_fn!` now has to be supported by Miri to even make stdout work. Unfortunately, it relies on some outside-of-Rust linker hacks (`#[link_section = ".CRT$XCU"]`) that are rather hard to make work in Miri. So I came up with this crude hack to make this stuff work in Miri regardless. It should come at no cost for regular executions, so I hope this is okay. Cc rust-lang#95627 `@ChrisDenton`
…Denton make windows compat_fn (crudely) work on Miri With rust-lang#95469, Windows `compat_fn!` now has to be supported by Miri to even make stdout work. Unfortunately, it relies on some outside-of-Rust linker hacks (`#[link_section = ".CRT$XCU"]`) that are rather hard to make work in Miri. So I came up with this crude hack to make this stuff work in Miri regardless. It should come at no cost for regular executions, so I hope this is okay. Cc rust-lang#95627 `@ChrisDenton`
Miri CI finally passes again. 🎉 This took a lot more time than I actually have, so I think next time Windows breaks in obscure ways I will have to just disable the tests for that platform and hope someone else can maintain that code. |
make windows compat_fn (crudely) work on Miri With rust-lang/rust#95469, Windows `compat_fn!` now has to be supported by Miri to even make stdout work. Unfortunately, it relies on some outside-of-Rust linker hacks (`#[link_section = ".CRT$XCU"]`) that are rather hard to make work in Miri. So I came up with this crude hack to make this stuff work in Miri regardless. It should come at no cost for regular executions, so I hope this is okay. Cc rust-lang/rust#95627 `@ChrisDenton`
Hello, this is your friendly neighborhood mergebot.
After merging PR #95624, I observed that the tool miri no longer builds.
A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout.
cc @Dylan-DPC, do you think you would have time to do the follow-up work?
If so, that would be great!
The text was updated successfully, but these errors were encountered: