[PATCH] D48051: LTO: Work around a Windows kernel bug by keeping file handles open for memory mapped files.

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 14:48:32 PDT 2018


zturner added a comment.

FWIW, I'm no longer convinced this is a Windows bug based on the reading of the blog post linked in comment 52 of the crbug.

But this comment worries me: "One gotcha is that the file handle that we keep open must not have been created with FILE_FLAG_DELETE_ON_CLOSE, as otherwise the operating system will prevent other processes from opening the file".  The aforementioned blog post hints that if other processes are being prevented from opening the file, then you've already gone astray.

Is there any we can just transfer ownership of the original handle (with `FILE_FLAG_DELETE_ON_CLOSE`) from whoever had it before to the `TempFile`.  This way we can just not close that handle until we're sure we're done with it.


https://reviews.llvm.org/D48051





More information about the llvm-commits mailing list