[MLton-user] CreateFile failed with error 80

Matthew Fluet fluet at tti-c.org
Sat May 17 21:10:38 PDT 2008


On Fri, 16 May 2008, Petersen, Leaf wrote:
> Someone asked about the significance of the "CreateFile failed with
> error 80" error message when running on cygwin a few days ago.  I
> couldn't remember where I'd seen it before until I just ran into it
> again.
>
> This seems to happen when you blow out your  heap on cygwin (or at
> least, that's a possible cause).

Yes, it was clear from the location in the runtime sources that prints the 
"CreateFile failed with error %ld" message that it corresponds to the 
portion of the runtime that attempts to page the heap to disk in order to 
allocate a larger heap. (<src>/runtime/platform/windows.c in the MLton 
sources.)

It seems that there were multiple bugs win the function to create and open 
a temporary file.  In particular, the Windows function GetTempFileName 
creates the fine in the process of obtaining a unique name; thus, the 
Windows function CreateFile was failing when it was called with the 
CREATE_NEW flag, which demands that the created file not exist.

I believe that the bug is now fixed by SVN r6624:
   http://mlton.org/cgi-bin/viewsvn.cgi?rev=6624&view=rev
You should be able to apply the diff of that revision to the 20070826 
sources, rebuild the runtime.

There was another bug in the code for paging the heap to disk, so in 
addition to the revision above, one would also need to apply the diff
from SVN r6600:
   http://mlton.org/cgi-bin/viewsvn.cgi?rev=6600&view=rev



More information about the MLton-user mailing list