DefParser crash on windows with `/GL` code
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
defparser crashes on windows when you use '/GL' optimization when you try and build a googletest.
This works with bazel 7.5.0, although I am suspicious if it ever called DefParser actions.
### Which category does this issue belong to?
C++ Rules
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Reproduction:
[defparsercrash.zip](https://github.com/user-attachments/files/19195291/defparsercrash.zip)
### Which operating system are you running Bazel on?
Windows 11
### What is the output of `bazel info release`?
release 8.1.1
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
```text
```
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
It works with 7.5.0 I don't believe the results from bisect:
```
bazel --bisect=7.5.0..8.1.1 test //...
--- Getting the list of commits between 7.5.0 and 8.1.1
The old Bazel commit is not an ancestor of the new Bazel commit, overriding the old Bazel commit to the merge base commit 0a2aac4e3c6f5ef98fc233e2ce83e44930edb188
Found 3808 commits between (0a2aac4e3c6f5ef98fc233e2ce83e44930edb188, 8.1.1]
--- Verifying if the given good Bazel commit (0a2aac4e3c6f5ef98fc233e2ce83e44930edb188) is actually good
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 84d80dc4-9c92-4d3b-850e-3dc41e235b45
INFO: Deleting stale sandbox base C:/dev/_bazel/57t5cn5a/sandbox
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 7.812s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_java~6.3.1; starting
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
Fetching repository @protobuf~27.0; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
Fetching ...5cn5a/external/rules_java~6.3.1; Extracting rules_java-6.3.1.tar.gz
Failure: Given good bazel commit is already broken.
--- Start bisecting
--- Testing with Bazel built at 351c720688e4ae7e82f5283a569f2079cad7245c, 3808 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 02771339-5cbd-42d4-828e-da2832e1ff1b
INFO: Analyzed target //:test (79 packages loaded, 494 targets configured).
ERROR: C:/dev/_bazel/57t5cn5a/external/googletest~/BUILD.bazel:170:11: DefParser external/googletest~/gtest_main.gen.def failed: (Exit -1073741819): def_parser.exe failed: error executing DefParser command (from target @@googletest~//:gtest_main)
cd /d C:/dev/_bazel/57t5cn5a/execroot/_main
SET PATH=C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\jamescarpenter\AppData\Local\bazelisk\downloads\sha256\b6cca780bb3d37de3bd7f0cb38d6ca2b1eba1bbde1de8e165d49323e49a10686\bin;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.5.0.0_x64__8wekyb3d8bbwe;C:\Program Files\Python311\Scripts\;C:\Program Files\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\chocolatey\bin;C:\Program Files\Graphviz\bin\;C:\dev\pkgs\trufflehog_3.83.6;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\OpenSSL\bin;C:\Program Files\GitHub CLI\;C:\dev\pkgs\bin;C:\dev\pkgs\buildifier_8.0.2;C:\Program Files\Git\cmd;C:\Users\jamescarpenter\AppData\Local\Microsoft\WindowsApps;C:\Users\jamescarpenter\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\jamescarpenter\AppData\Local\Microsoft\WinGet\Links;;c:\Users\jamescarpenter\AppData\Roaming\Code\User\globalStorage\github.copilot-chat\debugCommand
SET RUNFILES_MANIFEST_ONLY=1
external\bazel_tools\tools\def_parser\def_parser.exe bazel-out/x64_windows-opt/bin/external/googletest~/gtest_main.gen.def gtest_main_ed2deb93 @bazel-out/x64_windows-opt/bin/external/googletest~/gtest_main.gen.def-0.params
# Configuration: 5fdf822aa81ee6d86341f45b4cf4c4047fde75cf31fc9b701cbd2d4cfa616821
# Execution platform: @@platforms//host:host
Target //:test failed to build
INFO: Elapsed time: 18.666s, Critical Path: 2.01s
INFO: 21 processes: 10 internal, 11 local.
ERROR: Build did NOT complete successfully
//:test FAILED TO BUILD
Executed 0 out of 1 test: 1 fails to build.
--- Failed at 351c720688e4ae7e82f5283a569f2079cad7245c
--- Testing with Bazel built at 28c5b3ba023a1df8f13579d438eea05c42dc1394, 1904 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: f0246015-fd04-432e-a210-1550da9d5d4b
INFO: Deleting stale sandbox base C:/dev/_bazel/57t5cn5a/sandbox
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @@rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 7.940s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @@rules_java~7.3.2; starting
Fetching repository @@rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
Fetching repository @@protobuf~27.0; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
Fetching ...nfigure_extension in @@rules_cc~0.0.17//cc:extensions.bzl; starting
--- Failed at 28c5b3ba023a1df8f13579d438eea05c42dc1394
--- Testing with Bazel built at 18409dc44cac1fee1ece6e6a9b5a885b96a4f691, 952 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 7412d11d-08c7-4c01-8e73-acd50d61f87e
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @@rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 8.986s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @@rules_java~7.3.1; starting
Fetching repository @@rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
Fetching repository @@protobuf~27.0; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
Fetching ...nfigure_extension in @@rules_cc~0.0.17//cc:extensions.bzl; starting
--- Failed at 18409dc44cac1fee1ece6e6a9b5a885b96a4f691
--- Testing with Bazel built at c45bb5f61bd764d72d653bbda8bf179c1753d268, 476 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 57e36193-6b33-4db0-9cf0-0d5ff55d149e
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @@rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 7.053s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @@rules_java~7.1.0; starting
Fetching repository @@protobuf~27.0; starting
Fetching ...nfigure_extension in @@rules_cc~0.0.17//cc:extensions.bzl; starting
Fetching repository @@rules_python~0.33.2; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
--- Failed at c45bb5f61bd764d72d653bbda8bf179c1753d268
--- Testing with Bazel built at e9f02963168b502059aa7ed2f1c8b41f25f61984, 238 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 57373aa6-0a22-468f-bb97-055a417b52c1
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 7.616s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_java~7.0.6; starting
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
Fetching repository @protobuf~27.0; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
Fetching https://github.com/.../releases/download/7.0.6/rules_java-7.0.6.tar.gz
--- Failed at e9f02963168b502059aa7ed2f1c8b41f25f61984
--- Testing with Bazel built at 0a9c9a772fbefe2addd60947d9818414e1e823d2, 119 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 3ab3ca05-03a0-449f-a324-14022e9d51f9
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository rules_java~7.0.6 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.944s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
Fetching repository @protobuf~27.0; starting
Fetching ...bazel/57t5cn5a/external/protobuf~27.0; Extracting protobuf-27.0.zip
Fetching https://github.com/.../releases/download/7.0.6/rules_java-7.0.6.tar.gz
--- Failed at 0a9c9a772fbefe2addd60947d9818414e1e823d2
--- Testing with Bazel built at 9659ea61be5cd614a4002bc0f09acd44e18baa2b, 59 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: be51714d-4345-419d-809c-f1768db729dd
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 7.076s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_java~6.3.1; starting
Fetching repository @rules_python~0.33.2; starting
Fetching ...5cn5a/external/rules_java~6.3.1; Extracting rules_java-6.3.1.tar.gz
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
--- Failed at 9659ea61be5cd614a4002bc0f09acd44e18baa2b
--- Testing with Bazel built at d93af6b110a64c1f56519428f64704146da9f85d, 29 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 79d7b193-08ac-4565-b4ae-d72c7a178dba
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_java~6.3.1 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.346s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
--- Failed at d93af6b110a64c1f56519428f64704146da9f85d
--- Testing with Bazel built at 5708f165f078893c5bca6054108485a59af663fb, 14 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 86a3cf68-c318-4440-89d1-ea326f3ba9dc
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_python~0.33.2 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_java~6.3.1 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.291s, Critical Path: 0.07s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
--- Failed at 5708f165f078893c5bca6054108485a59af663fb
--- Testing with Bazel built at bb7fb2d32f055f2a70a5ab394cf5aef29bc74b2e, 7 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: b1558abf-d5b1-4362-a619-14dfc532978d
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_java~6.3.1 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.343s, Critical Path: 0.05s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
--- Failed at bb7fb2d32f055f2a70a5ab394cf5aef29bc74b2e
--- Testing with Bazel built at 58ce11244e475debf330abf282b5187172e28c36, 3 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 9125e269-dea1-4d93-8848-7eabf45b19c5
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_python~0.33.2 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
INFO: Repository rules_java~6.3.1 instantiated at:
: in
Repository rule http_archive defined at:
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.317s, Critical Path: 0.08s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
--- Failed at 58ce11244e475debf330abf282b5187172e28c36
--- Testing with Bazel built at bbc68d2ce7a54efd62927842454cd3ff8e4e89e3, 1 commits remaining...
bazel test //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 21880628-8715-415b-89a3-f8de7bf4a5e1
ERROR: Traceback (most recent call last):
File "C:/dev/_bazel/57t5cn5a/external/rules_cc~0.0.17/cc/extensions.bzl", line 23, column 38, in _cc_configure_extension_impl
return ctx.extension_metadata(reproducible = True)
Error in extension_metadata: extension_metadata() got unexpected keyword argument 'reproducible'
INFO: Repository protobuf~27.0 instantiated at:
: in
C:/dev/_bazel/57t5cn5a/external/bazel_tools/tools/build_defs/repo/http.bzl:379:31: in
ERROR: Analysis of target '//:test' failed; build aborted: error evaluating module extension cc_configure_extension in @rules_cc~0.0.17//cc:extensions.bzl
INFO: Elapsed time: 4.206s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
FAILED:
Fetching repository @rules_python~0.33.2; starting
Fetching ...external/rules_python~0.33.2; Extracting rules_python-0.33.2.tar.gz
--- Failed at bbc68d2ce7a54efd62927842454cd3ff8e4e89e3
--- Bisect Result
first bad commit is https://github.com/bazelbuild/bazel/commit/bbc68d2ce7a54efd62927842454cd3ff8e4e89e3
```
### Have you found anything relevant by searching the web?
I couldn't find anything relevant.
### Any other information, logs, or outputs that you want to share?
I ran def_parser on its own with windbg pointing at the files you can see from process monitor it happens shortly after it memory maps the first .obj file in the list it has parsed. I don't have the symbols available to do much of an indepth analysis, if you can point me to a symbol server I could get more info.
[windbg_output.txt](https://github.com/user-attachments/files/19195365/windbg_output.txt)
Contributor guide
Assessment
This issue has not been assessed yet.