From 0377ddd0b617c824b93d17e87bab028acc0ef3e7 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Tue, 15 Oct 2024 22:25:27 -0700 Subject: [PATCH] Also deploy `mozc_tip64.dll.pdb` (#1081) (#1082) One of the biggest challenge while investigating #1076 is that it has been reliably reproducible only on certain users' environments. One idea to accelerate the debugging in such a scenario is to ship debug symbol file for Mozc TIP DLL (e.g. mozc_tip64.dll) to users. Then we can ask the reporter to use tools like Process Explorer and Process Hacker to dump the call stack of the thread that got stuck. With this commit we actually start deploying mozc_tip64.dll.pdb to users. The storage impact looks to be acceptable overall as long as we strip private symbols [1]. Here are actual values taken in my local environment. * Mozc64.msi: + 584 kB * mozc_tip64.dll.pdb: + 6,116 kB Note that this commit does not fully take care of Bazel build. While the symbol file is actually deployed, there remain the following known issues only in Bazel build. * private symbols are not yet stripped out. * the symbol file name embedded in mozc_tip64.dll is mozc_tip.pdb rather than mozc_tip64.dll.pdb. [1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/public-and-private-symbols PiperOrigin-RevId: 686360089 --- src/win32/installer/build_installer.py | 2 ++ src/win32/installer/installer.gyp | 5 +++++ src/win32/installer/installer_64bit.wxs | 4 ++++ src/win32/installer/installer_oss_64bit.wxs | 4 ++++ src/win32/tip/BUILD.bazel | 5 +++++ src/win32/tip/tip.gyp | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/src/win32/installer/build_installer.py b/src/win32/installer/build_installer.py index 513696e04..69d51b941 100644 --- a/src/win32/installer/build_installer.py +++ b/src/win32/installer/build_installer.py @@ -88,6 +88,7 @@ def run_wix4(args) -> None: icon_path = pathlib.Path(args.icon_path).resolve() mozc_tip32 = pathlib.Path(args.mozc_tip32).resolve() mozc_tip64 = pathlib.Path(args.mozc_tip64).resolve() + mozc_tip64_pdb = mozc_tip64.with_suffix('.pdb') mozc_broker = pathlib.Path(args.mozc_broker).resolve() mozc_server = pathlib.Path(args.mozc_server).resolve() mozc_cache_service = pathlib.Path(args.mozc_cache_service).resolve() @@ -131,6 +132,7 @@ def run_wix4(args) -> None: '-define', f'AddRemoveProgramIconPath={icon_path}', '-define', f'MozcTIP32Path={mozc_tip32}', '-define', f'MozcTIP64Path={mozc_tip64}', + '-define', f'MozcTIP64PdbPath={mozc_tip64_pdb}', '-define', f'MozcBroker64Path={mozc_broker}', '-define', f'MozcServer64Path={mozc_server}', '-define', f'MozcCacheService64Path={mozc_cache_service}', diff --git a/src/win32/installer/installer.gyp b/src/win32/installer/installer.gyp index 612c6888c..c956d6bfa 100644 --- a/src/win32/installer/installer.gyp +++ b/src/win32/installer/installer.gyp @@ -58,6 +58,7 @@ 'mozc_server64_path': '<(outdir64_dynamic)/GoogleIMEJaConverter.exe', 'mozc_tip32_path': '<(outdir32)/GoogleIMEJaTIP32.dll', 'mozc_tip64_path': '<(outdir64)/GoogleIMEJaTIP64.dll', + 'mozc_tip64_pdb_path': '<(outdir64)/GoogleIMEJaTIP64.dll.stripped.pdb', 'mozc_tool_path': '<(outdir64_dynamic)/GoogleIMEJaTool.exe', }, { # branding!="GoogleJapaneseInput" 'upgrade_code': 'DD94B570-B5E2-4100-9D42-61930C611D8A', @@ -73,6 +74,7 @@ 'mozc_server64_path': '<(outdir64_dynamic)/mozc_server.exe', 'mozc_tip32_path': '<(outdir32)/mozc_tip32.dll', 'mozc_tip64_path': '<(outdir64)/mozc_tip64.dll', + 'mozc_tip64_pdb_path': '<(outdir64)/mozc_tip64.dll.stripped.pdb', 'mozc_tool_path': '<(outdir64_dynamic)/mozc_tool.exe', }], ], @@ -87,6 +89,7 @@ 'mozc_server64_path': '<(mozc_server64_path)', 'mozc_tip32_path': '<(mozc_tip32_path)', 'mozc_tip64_path': '<(mozc_tip64_path)', + 'mozc_tip64_pdb_path': '<(mozc_tip64_pdb_path)', 'mozc_tool_path': '<(mozc_tool_path)', 'mozc_broker64_path': '<(mozc_broker64_path)', 'mozc_ca64_path': '<(mozc_ca64_path)', @@ -101,6 +104,7 @@ '<(mozc_server64_path)', '<(mozc_tip32_path)', '<(mozc_tip64_path)', + '<(mozc_tip64_pdb_path)', '<(mozc_tool_path)', ], }, @@ -156,6 +160,7 @@ '-define', 'AddRemoveProgramIconPath=<(icon_path)', '-define', 'MozcTIP32Path=<(mozc_tip32_path)', '-define', 'MozcTIP64Path=<(mozc_tip64_path)', + '-define', 'MozcTIP64PdbPath=<(mozc_tip64_pdb_path)', '-define', 'MozcBroker64Path=<(mozc_broker64_path)', '-define', 'MozcServer64Path=<(mozc_server64_path)', '-define', 'MozcCacheService64Path=<(mozc_cache_service64_path)', diff --git a/src/win32/installer/installer_64bit.wxs b/src/win32/installer/installer_64bit.wxs index 208b662d7..9a24fcbd1 100644 --- a/src/win32/installer/installer_64bit.wxs +++ b/src/win32/installer/installer_64bit.wxs @@ -104,6 +104,7 @@ + @@ -247,6 +248,9 @@ + + + diff --git a/src/win32/installer/installer_oss_64bit.wxs b/src/win32/installer/installer_oss_64bit.wxs index 21cb2e832..1b5bfd81c 100644 --- a/src/win32/installer/installer_oss_64bit.wxs +++ b/src/win32/installer/installer_oss_64bit.wxs @@ -88,6 +88,7 @@ + @@ -222,6 +223,9 @@ + + + diff --git a/src/win32/tip/BUILD.bazel b/src/win32/tip/BUILD.bazel index 752c71ce1..963b852e2 100644 --- a/src/win32/tip/BUILD.bazel +++ b/src/win32/tip/BUILD.bazel @@ -45,6 +45,11 @@ load( mozc_cc_binary( name = "mozc_tip", srcs = ["mozc_tip_main.cc"], + features = ["generate_pdb_file"], + linkopts = [ + "/DEBUG:FULL", + "/PDBALTPATH:%_PDB%", + ], linkshared = True, tags = MOZC_TAGS.WIN_ONLY, target_compatible_with = ["@platforms//os:windows"], diff --git a/src/win32/tip/tip.gyp b/src/win32/tip/tip.gyp index 4825400dd..6fd20cc81 100644 --- a/src/win32/tip/tip.gyp +++ b/src/win32/tip/tip.gyp @@ -170,6 +170,10 @@ 'VCManifestTool': { 'EmbedManifest': 'true', }, + 'VCLinkerTool': { + # Generate stripped symbol. + 'AdditionalOptions': ['/PDBSTRIPPED:<(tipfile_product_name_win)64.dll.stripped.pdb'], + }, }, }, ],