[Issue 12349] New: std.File.flush and error causes segfault after calling close

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 11 22:10:32 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12349

           Summary: std.File.flush and error causes segfault after calling
                    close
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: ttanjo at gmail.com


--- Comment #0 from Tomoya Tanjo <ttanjo at gmail.com> 2014-03-11 22:10:12 PDT ---
In the following code, segfaultFlush and segfaultError cause segfault with DMD
v2.066-devel-a707998 in Mac OSX 10.9.2.

=====
import std.stdio;

void segfaultFlush() {
    auto f = File("deleteme", "w");
    scope(exit) "deleteme".remove;

    f.close();
    f.flush(); // segfault!
}

void segfaultError() {
    auto f = File("deleteme", "w");
    scope(exit) "deleteme".remove;

    f.close();
    assert(f.error); // segfault!
}

void main() {
    segfaultFlush();
    segfaultError();
}
=====

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list