https://issues.dlang.org/show_bug.cgi?id=14995
Issue ID: 14995
Summary: std.mmfile incorrectly handles errors in ctor
Product: D
Version: D2
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
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.
--