Skip to content

println!() does not panic when STDOUT returns ENOSPCΒ #78753

Closed
@GoldsteinE

Description

@GoldsteinE

I tried this code:

fn main() {
    println!("Hello, world!")
}

running it as cargo run > /dev/full or equivalent.

I expected to see this happen: as STDOUT is now "full" and write() syscall returns ENOSPC, println!() should panic, as per documentation.

Instead, this happened: println!() silently did nothing. Process returned 0 exit code.

Meta

Bug happens on stable, but is (probably) fixed on nightly
rustc --version --verbose:

rustc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: x86_64-unknown-linux-gnu
release: 1.47.0
LLVM version: 11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions