commit | 052a09014b2018e2a1e3b7f046ea9ad3355b831e | [log] [tgz] |
---|---|---|
author | Bruce Dawson <brucedawson@chromium.org> | Wed Jan 31 01:10:10 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jan 31 01:10:10 2018 |
tree | 7914062ed11657e3ff204397dd444ee43cbfcac6 | |
parent | 7686e185bd779c1fdd8ea7e76bb84f88b941ce24 [diff] |
Avoid Windows kernel bug using Python hack On about 3-4% of Chrome builds on my workstation one of the executables generated and then used during the build will crash. The binary on disk is always fine but the loader sometimes maps in pages of zeroes where it should be mapping in pages from the just-generated binary. Having a page of zeroes where you are expecting useful instructions tends to lead to crashes. This appears to be a bug in the OS disk cache. My suspicion is that this kernel bug only happens on multi-socket systems, but this is speculation. This bug happens regardless of which compiler or linker is used, and appears to happen on multiple Windows versions. The best reproes have been on Windows 10 Creators Update, or at least that is where I have done most of my testing. Extensive testing - hundreds of overnight builds - has shown that the problem goes away if FlushFileBuffers is called on the output file after linking is finished. Eventually this fix/hack will be coded into lld-link.exe, but for now it is put in tool_wrapper.py to fix the bug for both link.exe and lld-link.exe. Earlier versions of this fix only applied it to files with .exe extensions. However the bug is believed to have happened with DLLs, and may also affect .lib files created by the linkers, so now it is done always. The belief is that the performance impact will be negligible. Importing of win32file required some trickiness because in the context of ninja builds of Chrome the depot_tools python.bat file is apparently not called. This means that the python directory is not added to the system path. The python runtime correctly finds win32file.pyd and calls LoadLibrary on it but the OS then finds its dependencies in another version of python installed on the system and the DLL load fails if those are 64-bit instead of 32-bit. Bug: 644525 Change-Id: I71d63b47050385e2e5ba46ced9c8018220370ba7 Reviewed-on: https://chromium-review.googlesource.com/876683 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Zachary Turner <zturner@chromium.org> Reviewed-by: Scott Graham <scottmg@chromium.org> Cr-Commit-Position: refs/heads/master@{#533137}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .