Skip to content

[WIP] Attempt to reproduce Windows compiler crashes#6416

Draft
fhanau wants to merge 11 commits intomainfrom
felix/032426-reproduce-windows-crashes
Draft

[WIP] Attempt to reproduce Windows compiler crashes#6416
fhanau wants to merge 11 commits intomainfrom
felix/032426-reproduce-windows-crashes

Conversation

@fhanau
Copy link
Copy Markdown
Contributor

@fhanau fhanau commented Mar 25, 2026

Not ready for review, just trying to reproduce the compiler crash/see if changing compiler options could mitigate it

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick review of the WIP changes — flagging two issues I noticed.

.bazelrc Outdated
# Ref: https://github.com/llvm/llvm-project/issues/136481
build:release_windows --per_file_copt=.*capnp/rpc\.c++@/clang:-O1
build:windows --@capnp-cpp//src/kj:debug_memory=False
build:windows --per_file_copt=.*capnp/rpc\.c++@"/O2,/Gy,/Gw,-fstrict-aliasing,/clang:-O3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unmatched quote: there's a " before /O2 but no closing ". This will likely cause Bazel to parse the remainder of the file as part of this flag value, breaking everything after this line.

The stray quote should either be removed (to match the style used by the existing v8-codegen-opt-windows entries on lines 99-105) or a closing quote added at the end.

Suggested change
build:windows --per_file_copt=.*capnp/rpc\.c++@"/O2,/Gy,/Gw,-fstrict-aliasing,/clang:-O3
build:windows --per_file_copt=.*capnp/rpc\.c++@/O2,/Gy,/Gw,-fstrict-aliasing,/clang:-O3

.bazelrc Outdated
# This file breaks our CI windows release builds when compiled using O2/O3
# Ref: https://github.com/llvm/llvm-project/issues/136481
build:release_windows --per_file_copt=.*capnp/rpc\.c++@/clang:-O1
build:windows --@capnp-cpp//src/kj:debug_memory=False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional? Moving debug_memory=False and the per-file optimizations from config:release_windows to config:windows means they now apply to all Windows build modes (fastbuild, dbg, etc.), not just release builds. In particular:

  • debug_memory=False disables KJ debug-memory checks in all Windows builds, which line 200 explicitly enables for all platforms.
  • The per-file /O2 + /clang:-O3 opts on lines 435-437 compile rpc.c++, server.c++, and container-client.c++ at high optimization even in debug builds, which can make debugging those files difficult.

If this is intentional for reproducing the crash, ignore this — just flagging it so it doesn't accidentally land as-is.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 25, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR moves some Windows build config flags around in .bazelrc to try to reproduce compiler crashes, as noted in the WIP title.

Two issues found, posted as review comments on PR #6416:

  1. Unmatched quote (line 435) — The per_file_copt for rpc.c++ has an opening " before /O2 with no closing quote. This will likely break Bazel's parsing of subsequent lines. Suggestion provided.

  2. Config scope widened (lines 434-437)debug_memory=False and the per-file /O2+/clang:-O3 optimizations moved from config:release_windows to config:windows, meaning they now apply to all Windows builds (fastbuild, dbg, etc.), not just release. Flagged as potentially unintentional.

github run

@fhanau fhanau force-pushed the felix/032426-reproduce-windows-crashes branch 12 times, most recently from 312d2f3 to 2f69192 Compare March 26, 2026 20:59
@fhanau fhanau force-pushed the felix/032426-reproduce-windows-crashes branch 2 times, most recently from c929b55 to f500ffd Compare March 27, 2026 23:24
@fhanau fhanau marked this pull request as ready for review March 27, 2026 23:46
@fhanau fhanau requested review from a team as code owners March 27, 2026 23:46
@fhanau fhanau requested a review from emily-shen March 27, 2026 23:46
@fhanau fhanau force-pushed the felix/032426-reproduce-windows-crashes branch from 38ad8c2 to 67ad425 Compare March 27, 2026 23:48
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 38.31418% with 161 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.74%. Comparing base (47f5816) to head (7b2dbe8).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/workerd/server/container-client.c++ 0.00% 127 Missing ⚠️
src/workerd/server/server.c++ 74.62% 12 Missing and 5 partials ⚠️
src/workerd/server/alarm-scheduler.c++ 61.53% 8 Missing and 2 partials ⚠️
src/workerd/server/server-test.c++ 50.00% 0 Missing and 3 partials ⚠️
src/workerd/api/sockets.c++ 81.81% 0 Missing and 2 partials ⚠️
src/workerd/io/worker-entrypoint.c++ 95.45% 0 Missing and 1 partial ⚠️
src/workerd/server/alarm-scheduler.h 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6416      +/-   ##
==========================================
- Coverage   70.79%   70.74%   -0.05%     
==========================================
  Files         427      427              
  Lines      117869   117385     -484     
  Branches    18935    18891      -44     
==========================================
- Hits        83447    83048     -399     
+ Misses      23154    23090      -64     
+ Partials    11268    11247      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 28, 2026

Merging this PR will not alter performance

✅ 70 untouched benchmarks
⏩ 129 skipped benchmarks1


Comparing felix/032426-reproduce-windows-crashes (7b2dbe8) with main (f966235)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@fhanau fhanau marked this pull request as draft March 28, 2026 01:29
@fhanau fhanau force-pushed the felix/032426-reproduce-windows-crashes branch from 84da13b to ebfc418 Compare March 28, 2026 16:07
@fhanau fhanau force-pushed the felix/032426-reproduce-windows-crashes branch from ebfc418 to 7b2dbe8 Compare March 28, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants