https://issues.dlang.org/show_bug.cgi?id=6880
--- Comment #8 from Vladimir Panteleev <[email protected]> --- As I understand, what happens here is: 1. The program starts, and writes data to stdout / stderr 2. The data goes into the C FILE* buffer 3. When the buffer fills up, the C runtime attempts to flush it 4. Upon flushing, it discovers that the output handle in non-writable Perhaps the runtime could detect an unwritable stdout/stderr and close (or otherwise make invalid) the respective std.stdio handles. Though, even if writeln was changed to check if the output handle is writable on first or every write, the steps to reproduce would still apply - a forgotten writeln inside some rarely-executed code, such as an error handler, can still go through initial testing and end up crashing the application on the end-user's site. --
