Skip to content
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

Running tokio is not supported on Windows #1719

Open
HTGAzureX1212 opened this issue Feb 23, 2021 · 2 comments
Open

Running tokio is not supported on Windows #1719

HTGAzureX1212 opened this issue Feb 23, 2021 · 2 comments
Labels
A-files Area: related to files, paths, sockets, file descriptors, or handles A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@HTGAzureX1212
Copy link

HTGAzureX1212 commented Feb 23, 2021

Metadata

miri 0.1.0 (ea863353 2021-02-20)

Error Output, Upon Running cargo miri run

error: unsupported operation: can't call foreign function: CreateIoCompletionPort
   --> C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\miow-0.3.6\src\iocp.rs:48:28
    |
48  |         let ret = unsafe { CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0 as *mut _, 0, threads) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: CreateIoCompletionPort
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support

    = note: inside `miow::iocp::CompletionPort::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\miow-0.3.6\src\iocp.rs:48:28
    = note: inside `mio::sys::windows::selector::SelectorInner::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\mio-0.7.8\src\sys\windows\selector.rs:426:9
    = note: inside `mio::sys::windows::selector::Selector::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\mio-0.7.8\src\sys\windows\selector.rs:337:9
    = note: inside `mio::poll::Poll::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\mio-0.7.8\src\poll.rs:354:13
    = note: inside `tokio::io::driver::Driver::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.2.0\src\io\driver\mod.rs:115:20
    = note: inside `tokio::runtime::driver::create_io_stack` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.2.0\src\runtime\driver.rs:22:29
    = note: inside `tokio::runtime::driver::Driver::new` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.2.0\src\runtime\driver.rs:170:52
    = note: inside `tokio::runtime::Builder::build_threaded_runtime` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.2.0\src\runtime\builder.rs:533:39
    = note: inside `tokio::runtime::Builder::build` at C:\Users\<redacted>\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.2.0\src\runtime\builder.rs:382:34
note: inside `main` at src\main.rs:285:1
   --> src\main.rs:285:1
    |
285 | #[tokio::main]
    | ^^^^^^^^^^^^^^
    = note: inside `<fn() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>> as std::ops::FnOnce<()>>::call_once - shim(fn() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>>)` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227:5
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>>, std::result::Result<(), std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>>>` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys_common\backtrace.rs:125:18
    = note: inside closure at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:66:18
    = note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:259:13
    = note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:379:40
    = note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:343:19
    = note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:431:14
    = note: inside `std::rt::lang_start_internal` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:51:25
    = note: inside `std::rt::lang_start::<std::result::Result<(), std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>>>` at C:\Users\<redacted>\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:65:5
    = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
@RalfJung RalfJung changed the title Cannot run cargo miri on Windows using tokio Running tokio is not supported on Windows Feb 23, 2021
@RalfJung
Copy link
Member

Indeed, tokio is using lots of fancy OS APIs that Miri does not support. FWIW, it's not supported on Linux/macOS either: #602.

@RalfJung RalfJung added A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement labels Feb 23, 2021
@RalfJung RalfJung added the A-files Area: related to files, paths, sockets, file descriptors, or handles label May 5, 2024
@RalfJung
Copy link
Member

RalfJung commented May 5, 2024

Given that we don't even have basic support for file system access on Windows (#3482), I don't expect IO completions to materialize any time soon.

Meanwhile, the recommendation is to use --target x86_64-unknown-linux-gnu, which should work fine even on a Windows host. However, for tokio, that's blocked on #602.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-files Area: related to files, paths, sockets, file descriptors, or handles A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

2 participants