Last active
March 21, 2022 20:14
-
-
Save bahamas10/a773315ebbbdba445a11bd62206b0480 to your computer and use it in GitHub Desktop.
illumos LX (void linux) rustup hang - tokio hang bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "tokio-test" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
tokio = { version = "1.17.0", features = ["full"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tokio::fs; | |
use tokio::runtime::Builder; | |
fn main() { | |
let runtime = Builder::new_current_thread() | |
.enable_all() // THIS IS THE LINE THAT CAUSES THE BREAKAGE (this is default from the `tokio::main` macro) | |
.build() | |
.unwrap(); | |
runtime.block_on(async { | |
let want_data = b"data\n"; | |
let fname = "foo.txt"; | |
fs::write(fname, want_data).await.unwrap(); | |
let got_data = fs::read(fname).await.unwrap(); | |
println!("want_data = {:?}", want_data); | |
println!("got_data = {:?}", got_data); | |
assert_eq!(got_data, want_data); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this bug has been narrowed down to
epoll
-> https://gist.github.com/bahamas10/d158ac87271c926aa32a0528faca03d6