From 93e1a76ec4ba7e68fde71577a950f04907787eb4 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Mon, 10 Apr 2017 11:19:58 -0700 Subject: [PATCH] Actually enable crash dump collection on builders Change crrev.com/1825163003 attempted to enable crash dump collection on build machines, and it worked fine on local testing. However it only worked because local testing was done using 64-bit Python. The builders use python from depot_tools which is 32-bit Python so the changes all went to "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft" instead of to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft", which means they were ignored. For a year. This made investigation of linker crashes more complicated than needed. This change uses the necessary winreg.KEY_WOW64_64KEY dance so that the 64-bit registry is always used, whether running 32-bit Python or 64-bit Python. Both versions were tested locally. The behavior on 32-bit Windows is unknown but we don't support building on 32-bit Windows anyway, and any failures would be rendered harmless by the try/except block. R=scottmg@chromium.org BUG=704286 Change-Id: I6abc0e1e9c69b9a4e4b9c705bea9e4faadd0945c Reviewed-on: https://chromium-review.googlesource.com/473567 Reviewed-by: Robbie Iannucci Reviewed-by: Scott Graham Commit-Queue: Bruce Dawson --- win_toolchain/get_toolchain_if_necessary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py index d55674f3b..df04b0646 100755 --- a/win_toolchain/get_toolchain_if_necessary.py +++ b/win_toolchain/get_toolchain_if_necessary.py @@ -374,7 +374,8 @@ def EnableCrashDumpCollection(): if sys.platform == 'win32' and os.environ.get('CHROME_HEADLESS') == '1': key_name = r'SOFTWARE\Microsoft\Windows\Windows Error Reporting' try: - key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, key_name) + key = winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, key_name, 0, + winreg.KEY_WOW64_64KEY | winreg.KEY_ALL_ACCESS) # Merely creating LocalDumps is sufficient to enable the defaults. winreg.CreateKey(key, "LocalDumps") # Disable the WER UI, as documented here: