[Issue 6880] Heisenbug: deferred crash when writing to stdout on Windows without console.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 25 10:28:43 PST 2015


https://issues.dlang.org/show_bug.cgi?id=6880

Denis Shelomovskij <verylonglogin.reg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #4 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to AndyC from comment #3)
> I test this, on windows, with DMD v2.066.1:
> 
> ---- file test.d:
> import std.stdio;
> 
> void main()
> {
>    writeln("hello world");
> }
> 
> 
> comile:
> dmd -L/SUBSYSTEM:WINDOWS test.d
> 
> ran it by dbl-clicking and from cmd.exe.  No exception, no error.
> 
> I checked std/typecons.d and found no write's without debug.
> 
> Closing.
> 
> Please re-open if its still a problem, and please provide more specific
> steps to reproduce.  "take tons of user feedback" doesn't help me fix the
> problem.

As I had written in the issue description it's a deffered failure (i.e. some
buffer overflows). One can use any testcase which prints enough data to
overflow the buffer, e.g.:
---
import std.stdio;

void main()
{
    foreach(const i; 0 .. 100_000)
        write("12345678"); // for me fails at i = 2048
}
---

--


More information about the Digitalmars-d-bugs mailing list