Bug 14995 – std.mmfile incorrectly handles errors in ctor
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-01T11:30:00Z
Last change time
2015-10-04T18:20:42Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2015-09-01T11:30:27Z
If the MmFile ctor fails, it will often close the file but leave the fd field set. This will cause its destructor to later attempt to close it again, which will either cause an exception (which in turn will likely result in an InvalidMemoryOperationError), or close an unrelated file with the same coincidental fd.
Comment #1 by dlang-bugzilla — 2015-09-01T11:38:18Z