Skip to content

"error writing buffer" on Windows when piped #8330

Closed
@darkf

Description

@darkf

On Windows, emitting a lot of text, for example using this program:

    fn main() {
        for _ in range(0, 1000) {
            println("nananananana");
        }
    }

If you pipe it to a program like head, it can (as in, it's seemingly random, probably due to OS buffering, but occurs a lot for small n) fail with "The operation completed successfully.\r\n".

Example:

$ reproduce.exe | head -n 1
nananananana
rust: ~"\"error writing buffer\""
rust: ~"The operation completed successfully.\r\n"
rust: task failed at 'explicit failure', C:\Users\darkf\Desktop\rust\src\libstd\io.rs:1223
rust: domain main @0x923960 root task failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions