Skip to content

Commit 0377ddd

Browse files
authored
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
1 parent 161849a commit 0377ddd

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

src/win32/installer/build_installer.py

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def run_wix4(args) -> None:
8888
icon_path = pathlib.Path(args.icon_path).resolve()
8989
mozc_tip32 = pathlib.Path(args.mozc_tip32).resolve()
9090
mozc_tip64 = pathlib.Path(args.mozc_tip64).resolve()
91+
mozc_tip64_pdb = mozc_tip64.with_suffix('.pdb')
9192
mozc_broker = pathlib.Path(args.mozc_broker).resolve()
9293
mozc_server = pathlib.Path(args.mozc_server).resolve()
9394
mozc_cache_service = pathlib.Path(args.mozc_cache_service).resolve()
@@ -131,6 +132,7 @@ def run_wix4(args) -> None:
131132
'-define', f'AddRemoveProgramIconPath={icon_path}',
132133
'-define', f'MozcTIP32Path={mozc_tip32}',
133134
'-define', f'MozcTIP64Path={mozc_tip64}',
135+
'-define', f'MozcTIP64PdbPath={mozc_tip64_pdb}',
134136
'-define', f'MozcBroker64Path={mozc_broker}',
135137
'-define', f'MozcServer64Path={mozc_server}',
136138
'-define', f'MozcCacheService64Path={mozc_cache_service}',

src/win32/installer/installer.gyp

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
'mozc_server64_path': '<(outdir64_dynamic)/GoogleIMEJaConverter.exe',
5959
'mozc_tip32_path': '<(outdir32)/GoogleIMEJaTIP32.dll',
6060
'mozc_tip64_path': '<(outdir64)/GoogleIMEJaTIP64.dll',
61+
'mozc_tip64_pdb_path': '<(outdir64)/GoogleIMEJaTIP64.dll.stripped.pdb',
6162
'mozc_tool_path': '<(outdir64_dynamic)/GoogleIMEJaTool.exe',
6263
}, { # branding!="GoogleJapaneseInput"
6364
'upgrade_code': 'DD94B570-B5E2-4100-9D42-61930C611D8A',
@@ -73,6 +74,7 @@
7374
'mozc_server64_path': '<(outdir64_dynamic)/mozc_server.exe',
7475
'mozc_tip32_path': '<(outdir32)/mozc_tip32.dll',
7576
'mozc_tip64_path': '<(outdir64)/mozc_tip64.dll',
77+
'mozc_tip64_pdb_path': '<(outdir64)/mozc_tip64.dll.stripped.pdb',
7678
'mozc_tool_path': '<(outdir64_dynamic)/mozc_tool.exe',
7779
}],
7880
],
@@ -87,6 +89,7 @@
8789
'mozc_server64_path': '<(mozc_server64_path)',
8890
'mozc_tip32_path': '<(mozc_tip32_path)',
8991
'mozc_tip64_path': '<(mozc_tip64_path)',
92+
'mozc_tip64_pdb_path': '<(mozc_tip64_pdb_path)',
9093
'mozc_tool_path': '<(mozc_tool_path)',
9194
'mozc_broker64_path': '<(mozc_broker64_path)',
9295
'mozc_ca64_path': '<(mozc_ca64_path)',
@@ -101,6 +104,7 @@
101104
'<(mozc_server64_path)',
102105
'<(mozc_tip32_path)',
103106
'<(mozc_tip64_path)',
107+
'<(mozc_tip64_pdb_path)',
104108
'<(mozc_tool_path)',
105109
],
106110
},
@@ -156,6 +160,7 @@
156160
'-define', 'AddRemoveProgramIconPath=<(icon_path)',
157161
'-define', 'MozcTIP32Path=<(mozc_tip32_path)',
158162
'-define', 'MozcTIP64Path=<(mozc_tip64_path)',
163+
'-define', 'MozcTIP64PdbPath=<(mozc_tip64_pdb_path)',
159164
'-define', 'MozcBroker64Path=<(mozc_broker64_path)',
160165
'-define', 'MozcServer64Path=<(mozc_server64_path)',
161166
'-define', 'MozcCacheService64Path=<(mozc_cache_service64_path)',

src/win32/installer/installer_64bit.wxs

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
<Feature Id="GIMEJaInstall" Title="Google 日本語入力" Level="1">
105105
<ComponentRef Id="GIMEJaTIP32" />
106106
<ComponentRef Id="GIMEJaTIP64" />
107+
<ComponentRef Id="GIMEJaTIP64Pdb" />
107108
<ComponentRef Id="GIMEJaBroker" />
108109
<ComponentRef Id="GIMEJaConverter" />
109110
<ComponentRef Id="GIMEJaCacheService" />
@@ -247,6 +248,9 @@
247248
<Class Context="InprocServer32" ThreadingModel="apartment" Description="Google Japanese Input" Id="D5A86FD5-5308-47EA-AD16-9C4EB160EC3C" />
248249
</File>
249250
</Component>
251+
<Component Id="GIMEJaTIP64Pdb" Permanent="no" Bitness="always64">
252+
<File Id="GoogleIMEJaTIP64.dll.pdb" Name="GoogleIMEJaTIP64.dll.pdb" DiskId="1" Checksum="yes" Source="$(var.MozcTIP64PdbPath)" Vital="yes" />
253+
</Component>
250254
<Component Id="GIMEJaBroker" Permanent="no">
251255
<File Id="GoogleIMEJaBroker.exe" Name="GoogleIMEJaBroker.exe" DiskId="1" Checksum="yes" Source="$(var.MozcBroker64Path)" Vital="yes" />
252256
</Component>

src/win32/installer/installer_oss_64bit.wxs

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<Feature Id="MozcInstall" Title="Mozc" Level="1">
8989
<ComponentRef Id="MozcTIP32" />
9090
<ComponentRef Id="MozcTIP64" />
91+
<ComponentRef Id="MozcTIP64Pdb" />
9192
<ComponentRef Id="MozcBroker" />
9293
<ComponentRef Id="MozcConverter" />
9394
<ComponentRef Id="MozcCacheService" />
@@ -222,6 +223,9 @@
222223
<Class Context="InprocServer32" ThreadingModel="apartment" Description="Mozc" Id="10A67BC8-22FA-4A59-90DC-2546652C56BF" />
223224
</File>
224225
</Component>
226+
<Component Id="MozcTIP64Pdb" Permanent="no" Bitness="always64">
227+
<File Id="mozc_tip64.dll.pdb" Name="mozc_tip64.dll.pdb" DiskId="1" Checksum="yes" Source="$(var.MozcTIP64PdbPath)" Vital="yes" />
228+
</Component>
225229
<Component Id="MozcBroker" Permanent="no">
226230
<File Id="mozc_broker.exe" Name="mozc_broker.exe" DiskId="1" Checksum="yes" Source="$(var.MozcBroker64Path)" Vital="yes" />
227231
</Component>

src/win32/tip/BUILD.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ load(
4545
mozc_cc_binary(
4646
name = "mozc_tip",
4747
srcs = ["mozc_tip_main.cc"],
48+
features = ["generate_pdb_file"],
49+
linkopts = [
50+
"/DEBUG:FULL",
51+
"/PDBALTPATH:%_PDB%",
52+
],
4853
linkshared = True,
4954
tags = MOZC_TAGS.WIN_ONLY,
5055
target_compatible_with = ["@platforms//os:windows"],

src/win32/tip/tip.gyp

+4
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@
170170
'VCManifestTool': {
171171
'EmbedManifest': 'true',
172172
},
173+
'VCLinkerTool': {
174+
# Generate stripped symbol.
175+
'AdditionalOptions': ['/PDBSTRIPPED:<(tipfile_product_name_win)64.dll.stripped.pdb'],
176+
},
173177
},
174178
},
175179
],

0 commit comments

Comments
 (0)