Skip to content

Commit

Permalink
[5571] Enable large pdbs by default
Browse files Browse the repository at this point in the history
(This is for testing symupload on official builders. Branch 5571 is
approved by TPM)

Windows PDBs default to using a page size of 4 KiB and have a maximum of
2^20 pages. This gives them a maximum size of 4 GiB which Chrome's test
binaries have already started exceeding in some configuration, and
chrome.dll is rapidly approaching. This problem was anticipated in 2020
(https://developercommunity.visualstudio.com/t/pdb-limit-of-4-gib-is-likely-to-be-a-problem-in-a/904784)
and windbg, the Visual Studio debugger, the Visual Studio linker, the
lld linker, Windows Performance Analyzer, and other tools were updated
to support larger page sizes and therefore larger PDBs.

Separately, another limitation of 4 KiB PDB pages was found when doing
ARM64 Windows builds of Chrome, documented here:

https://bugs.chromium.org/p/chromium/issues/detail?id=1406510#c32

Large PDBs require an updated version of dbghelp.dll, but we have long
been prevented from updating dbghelp.dll because newer versions of the
debugger tools don't work on Windows 7. Now that Windows 7 is no longer
supported we are finally able to upgrade dbghelp.dll.

Therefore this change:

- changes the default value of use_large_pdbs to true, switching us to
an 8 KiB page size, allowing 8 GiB PDBs. This page size can be trivially
increased if needed in the future.
- changes the toolchain hash to one with the new Debuggers directory
(details below)
- Adds $root_out_dir/dbghelp.dll to runtime_libs so that we deploy
dbghelp.dll to all test bots.

Because large PDBs fail with the version of dbghelp.dll that we have in
the toolchain package this change also includes the hash of a new
toolchain package. This was created by copying over the five main
directories from the Debuggers directory from the Windows 11 SDK
(version 10.0.22621.755) to the current packaged toolchain and
repackaging. The commands to do this are:

  cd "third_party\depot_tools\win_toolchain\vs_files\1023ce2e82\Windows Kits\10\Debuggers"
  rmdir . /s/q
  xcopy "c:\Program Files (x86)\Windows Kits\10\Debuggers" . /s/v >nul
  rmdir arm /s/q
  rmdir ddk /s/q
  rmdir redist /s/q
  cd ..\..\..\..
  call python3 ..\package_from_installed.py --repackage 1023ce2e82

Bug: 1273169, 1245726, 1406510
Change-Id: Ic1cd02c6b38bb1b8eb2b6a6ec542a7ff29f644a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4215832
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Cr-Commit-Position: refs/branch-heads/5571@{#3}
Cr-Branched-From: 07abeeb-refs/heads/main@{#1099166}
  • Loading branch information
randomascii authored and Chromium LUCI CQ committed Feb 1, 2023
1 parent 4c1173e commit da8af3d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/config/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare_args() {
# Indicates whether to use /pdbpagesize:8192 to allow PDBs larger than 4 GiB.
# This requires updated debugging and profiling tools which are not widely
# distributed yet which is why it is currently opt-in.
use_large_pdbs = false
use_large_pdbs = true
}

# This is included by reference in the //build/config/compiler config that
Expand Down
4 changes: 2 additions & 2 deletions build/vs_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from gn_helpers import ToGNString

# VS 2019 16.61 with 10.0.20348.0 SDK, 10.0.19041 version of Debuggers
# VS 2019 16.61 with 10.0.20348.0 SDK, 10.0.22621.755 version of Debuggers,
# with ARM64 libraries and UWP support.
# See go/chromium-msvc-toolchain for instructions about how to update the
# toolchain.
Expand All @@ -32,7 +32,7 @@
# Affects the availability of APIs in the toolchain headers.
# * //docs/windows_build_instructions.md mentions of VS or Windows SDK.
# Keeps the document consistent with the toolchain version.
TOOLCHAIN_HASH = '1023ce2e82'
TOOLCHAIN_HASH = '0b5ee4d2b1'

script_dir = os.path.dirname(os.path.realpath(__file__))
json_data_file = os.path.join(script_dir, 'win_toolchain.json')
Expand Down
3 changes: 2 additions & 1 deletion build/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ if (is_win) {
}

group("runtime_libs") {
data = []
# This is needed for any tests that need to decode stacks.
data = [ "$root_out_dir/dbghelp.dll" ]
if (is_component_build) {
# Copy the VS runtime DLLs into the isolate so that they don't have to be
# preinstalled on the target machine. The debug runtimes have a "d" at
Expand Down
5 changes: 3 additions & 2 deletions docs/windows_build_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ $ PATH_TO_INSTALLER.EXE ^
--includeRecommended
```

-You must have the version 10.0.20348.0 [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
-You must have the version 10.0.22621.755 [Windows 11 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)
installed. This can be installed separately or by checking the appropriate box
in the Visual Studio Installer.
in the Visual Studio Installer. Earlier versions will work except for some test
failures when decoding large-page PDBs that are unsupported in prior SDKs.

The SDK Debugging Tools must also be installed. If the Windows 10 SDK was
installed via the Visual Studio installer, then they can be installed by going
Expand Down

0 comments on commit da8af3d

Please sign in to comment.