News for hackers. Stuff that matters.
Re:Compiler bug? Linker bug? Windows Kernel bug by quietbritishjim on Monday February 26, 2018 @05:20AM (#16464324)
How does your comment contradict the parent one?
Re:Compiler bug? Linker bug? Windows Kernel bug by DougBTX on Monday February 26, 2018 @05:58AM (#16464468)
The parent uses weasel words https://en.wikipedia.org/wiki/Weasel_word that, while technically correct, imply something false. The comment is refuting the implication.

Here the implication is that there is a fundamental design flaw in the OS that may cause widespread issues, when really this is a bug in quite a narrow edge case: it may happen when building colossal projects repeatedly on very high spec computers, the article suggests that the team at Microsoft investigating the bug couldn't reproduce it since they couldn't build Chrome as quickly as the author could.

Re:Compiler bug? Linker bug? Windows Kernel bug by barrkel on Monday February 26, 2018 @05:29AM (#16464360)
Memory-mapped I/O is a lot more precise a description of "writing" and more unusual than simply writing out, and execution similarly is not a normal read path for a just-written file.

The parent made it sounds like you could just write a loop with for(;;) { write_file("x"); read_file("x"); } and expect discrepancies. That's not the case and it's wilfully misleading to suggest it is.

Re:Compiler bug? Linker bug? Windows Kernel bug by quietbritishjim on Monday February 26, 2018 @07:18AM (#16464762)
The parent said "in some cases". I guess it could be misinterpreted, but I took that to mean "in some very specific access patterns" (rather than, say, "in any access pattern some random small proportion of the time").
Re:Compiler bug? Linker bug? Windows Kernel bug by ksk on Monday February 26, 2018 @11:41AM (#16466603)
Um, also, in some cases, I might win the lottery.
Re:Compiler bug? Linker bug? Windows Kernel bug by narag on Monday February 26, 2018 @05:36AM (#16464383)
Writing a binary executable file is not a common situation, only compilers do that. If you add the unusual heavy IO, this is a fringe case.
Re:Compiler bug? Linker bug? Windows Kernel bug by vardump on Monday February 26, 2018 @06:11AM (#16464522)
> Writing a binary executable file is not a common situation, only compilers do that.

Not only compilers. Decompressors (.zip, etc.), installers and auto-updaters. There are more use cases for writing out executables than just compilers.

Although these cases probably write sequentially and don't need to memory map the file and update sections in a random access fashion.

Re:Compiler bug? Linker bug? Windows Kernel bug by narag on Monday February 26, 2018 @06:45AM (#16464634)
Look, there are a handful of details in the description that, for the right person, clearly and right away indicates that it's a very very specific, even fringe case. Saying that "basically it means..." as if it was a general case is terribly misguided because it's not. There are already a few comments explaining just that. Insisting in a misunderstanding is not very useful.
Re:Compiler bug? Linker bug? Windows Kernel bug by mehrdadn on Monday February 26, 2018 @05:57AM (#16464466)
[Edit: whoops, never mind, thanks. Might be worth adding the memory-mapped part to your comment to clarify for others too.]
Re:Compiler bug? Linker bug? Windows Kernel bug by DougBTX on Monday February 26, 2018 @06:14AM (#16464531)
You're right that it is an example of a case that matches the "basic" description of the conditions to hit the bug, but it probably won't satisfy any of the three conditions when they are considered in detail:

* The files being written probably won't be using memory mapped IO (I'd expect them to use the equivalent of fwrite instead) as the installer won't need to make complex changes to the binaries in the same way that a compiler/linker would

* There will likely be a significant delay between writing the file and running it compared with a build process that uses its own build output as part of the build (even in the build process case, the bug went away for a year, possibly due to an additional delay between the write and execute steps)

* Once the installer has run, the system will probably not be under heavy load (the author was running a highly parallel build on a 24-core machine, and this bug was still only hit in 3% of builds)

Really the earlier post was just misleading, as it implies the bug is much easier to hit than it really is.

Re:Compiler bug? Linker bug? Windows Kernel bug by kuschku on Monday February 26, 2018 @08:37AM (#16465129)
There are other use cases where this might occur, though – JITs that store JITed binaries on disk.

That’s rare (usually there you’d read it back in and execute in your process space), but it’d be at least a second realistic scenario.

Re:Compiler bug? Linker bug? Windows Kernel bug by narag on Monday February 26, 2018 @06:05AM (#16464504)
Not the same. Notice the memory mapped file bit.
Re:Compiler bug? Linker bug? Windows Kernel bug by quietbritishjim on Monday February 26, 2018 @06:23AM (#16464564)
I agree. But the comment I was referring to said "in some cases"; it never claimed it was a common case.