-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
stdin().read_u8 results in unknown error (OS Error 8 (FormatMessageW() returned error 15105)) #13304
Comments
Error 8 indicates ERROR_NOT_ENOUGH_MEMORY. |
No, it's just a main function containing the above code. |
I suspect that this is a duplicate of #13259. What happens if you add this right before you read from stdin? unsafe { ::std::rt::stack::record_sp_limit(0); } |
With that I get "unknown error (OS Error 8: Not enough storage is available to process this command.)" |
I am getting the same error with the following code ...
I am using Rust 0.10 on Windows 7 (i686-pc-mingw32). Please see my discussion about it on Reddit. |
Apparently this is because we're using a buffered reader on windows. It looks like windows returns this error when using a 64K buffer and a 32K buffer. Decreasing it to 16K makes the kernel happy apparently (who knew?) |
While not quite the same, looks like libuv has run across the same issue |
Apparently windows doesn't like reading from stdin with a large buffer size, and it also apparently is ok with a smaller buffer size. This changes the reader returned by stdin() to return an 8k buffered reader for stdin rather than a 64k buffered reader. Apparently libuv has run into this before, taking a peek at their code, with a specific comment in their console code saying that "ReadConsole can't handle big buffers", which I presume is related to invoking ReadFile as if it were a file descriptor. Closes rust-lang#13304
Wow! |
I just wanted to say thank you to the guys who researched and resolved this. I see the latest Windows Installer has the update in it and my example code now works in Windows 7. That was a quick turn around, thanks!! :) |
Output: "unknown error (OS Error 8 (FormatMessageW() returned error 15100))"
Win 7
rustc 0.10
host: i686-pc-mingw32
The text was updated successfully, but these errors were encountered: