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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 15:08:49 PDT 2018


pcc added a comment.

In https://reviews.llvm.org/D48051#1129001, @inglorion wrote:

> Thanks for the fix! A couple of suggestions:
>
> I wouldn't call it a bug unless we are sure that it is. My reading of the documentation of FILE_FLAG_DELETE_ON_CLOSE is that what we're hitting may actually be the intended behavior. Instead of "bug", can we describe is at "observed behavior" or words to that effect? That way, we aren't implying that the behavior is incorrect while still explaining why our code needs to be the way it is.


Okay.

> The documentation for FILE_FLAG_DELETE_ON_CLOSE also mentions "Subsequent open requests for the file fail, unless the FILE_SHARE_DELETE share mode is specified." I wonder if we could use that to avoid having to split keep(). I think that would make the tempfile API a little nicer, although I'm ok splitting keep() if that's what we have to do to make it correct.

By "that" do you mean the "unless the FILE_SHARE_DELETE share mode is specified" part? Unfortunately that doesn't seem to work; even if both processes pass `FILE_SHARE_DELETE` the open still fails.


https://reviews.llvm.org/D48051





More information about the llvm-commits mailing list