You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
luqmana opened this issue
Nov 25, 2013
· 0 comments
· Fixed by #10646
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-windowsOperating system: Windows
use std::io;fnmain(){
do spawn {
let b = io::stdin().read_byte().unwrap();println!("Got: {}", b aschar);}}
$ rustc.exe foo.rs
$ foo.exe
task '<unnamed>' failed at 'stream alloc_cb called more than once', C:\MinGW\msys\1.0\home\Luqman\rust\src\libstd\option.rs:113
task '<main>' failed at 'killed by linked failure', C:\MinGW\msys\1.0\home\Luqman\rust\src\libstd\rt\kill.rs:639
This is a behavioral difference in libuv between different platforms in
different situations. It turns out that libuv on windows will immediately
allocate a buffer instead of waiting for data to be ready. What this implies is
that we must have our custom data set on the handle before we call
uv_read_start.
I wish I knew of a way to test this, but this relies to being on the windows
platform *and* reading from a true TTY handle which only happens when this is
actually attached to a terminal. I have manually verified this works.
Closes#10645
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-windowsOperating system: Windows
foo.rs:
Adding
#[no_uv]
makes it works as expected:Ping @alexcrichton
The text was updated successfully, but these errors were encountered: