aarch64-pc-windows-msvc: -Cprofile-generate binary segfaults during PGO training
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
Summary
On aarch64-pc-windows-msvc, a Rust binary built with -Cprofile-generate segfaults during ordinary execution. The same project built as a normal LTO release binary (cargo build --release --locked) runs and self-checks successfully.
This was observed while building release artifacts for https://github.com/vjovanov/grund. The failure looks specific to the PGO-instrumented binary or profiling runtime: the instrumented executable builds successfully, then crashes during the PGO training run. llvm-profdata then reports malformed .profraw files.
I am filing this against rust-lang/rust first because the user-visible trigger is rustc -Cprofile-generate; this may ultimately belong in LLVM/compiler-rt.
Not transient
This reproduced in three separate GitHub Actions runs on windows-11-arm / windows-11-arm64:
- Failed release run: https://github.com/vjovanov/grund/actions/runs/26000032777/job/76421409507
- Recovery release run, with fallback added after PGO failure: https://github.com/vjovanov/grund/actions/runs/26000896601/job/76423823987
- Fresh non-publishing dry-run release to re-check transience: https://github.com/vjovanov/grund/actions/runs/26001277253/job/76424832805
All three runs used:
Image: windows-11-arm64
Image Version: 20260510.38.1
Runner version: 2.334.0
rustc 1.95.0 (59807616e 2026-04-14)
host: aarch64-pc-windows-msvc
LLVM version: 22.1.2
The same PGO pipeline passed on Linux x86_64/aarch64, macOS x86_64/aarch64, and Windows x86_64 in the same workflow runs.
Reproducer
On Windows ARM64 with Git Bash available:
git clone https://github.com/vjovanov/grund.git
cd grund
git checkout v0.2.0
rustup toolchain install 1.95.0-aarch64-pc-windows-msvc
rustup override set 1.95.0
rustup component add llvm-tools-preview
bash scripts/pgo-build.sh
The script does the following:
- Builds the binary with
RUSTFLAGS=-Cprofile-generate=<target/pgo-data> cargo build --release --locked. - Runs the freshly built
target/release/grund.exeagainst this repository as its PGO training workload. - Merges the generated
.profrawfiles withllvm-profdata. - Rebuilds with
-Cprofile-use.
The failure happens in step 2. A more direct manual reduction from the script is:
repo="$PWD"
pgo_dir="$repo/target/pgo-data"
rm -rf "$pgo_dir"
mkdir -p "$pgo_dir"
# On Git Bash, rustc wants a Windows-style profile path.
pgo_dir_rustc="$(cygpath -m "$pgo_dir")"
RUSTFLAGS="-Cprofile-generate=$pgo_dir_rustc" cargo build --release --locked
./target/release/grund.exe list "$repo"
Observed: the instrumented grund.exe segfaults.
Expected: the instrumented binary should run normally and emit valid .profraw profile data, as it does on the other release targets.
CI log excerpts
Fresh dry-run release, run 26001277253:
PGO binary (windows-11-arm) Set up job
Current runner version: '2.334.0'
Runner Image Provisioner Version: 20260415.520
Image: windows-11-arm64
Version: 20260510.38.1
rustc 1.95.0 (59807616e 2026-04-14)
host: aarch64-pc-windows-msvc
LLVM version: 22.1.2
==> 1/3 build instrumented binary (-Cprofile-generate)
Finished `release` profile [optimized] target(s) in 52.76s
==> 2/3 training run — the §AR-benchmarks workload
scripts/pgo-build.sh: line 66: 324 Segmentation fault "$grund" list "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 325 Segmentation fault "$grund" show FS-check --brief "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 326 Segmentation fault "$grund" show FS-check "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 327 Segmentation fault "$grund" show FS-check --full "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 328 Segmentation fault "$grund" refs GOAL-fast-feedback "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 329 Segmentation fault "$grund" cover "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 330 Segmentation fault "$grund" fmt --check "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 331 Segmentation fault "$grund" check "$repo" > /dev/null 2>&1
...
warning: C:/a/grund/grund/target/pgo-data/default_2211884963031461884_0.profraw: malformed instrumentation profile data: symbol name is empty
error: no profile can be merged
Original failed release, run 26000032777:
Image: windows-11-arm64
Version: 20260510.38.1
rustc 1.95.0 (59807616e 2026-04-14)
host: aarch64-pc-windows-msvc
LLVM version: 22.1.2
==> 2/3 training run — the §AR-benchmarks workload
scripts/pgo-build.sh: line 66: 1286 Segmentation fault "$grund" list "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 1287 Segmentation fault "$grund" show FS-check --brief "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 1288 Segmentation fault "$grund" show FS-check "$repo" > /dev/null 2>&1
...
warning: C:/a/grund/grund/target/pgo-data/default_15662148217428528836_0.profraw: malformed instrumentation profile data: symbol name is empty
warning: C:/a/grund/grund/target/pgo-data/default_6987841190259789436_0.profraw: malformed instrumentation profile data: symbol name is empty
warning: C:/a/grund/grund/target/pgo-data/default_2211884963031461884_0.profraw: malformed instrumentation profile data: symbol name is empty
error: no profile can be merged
Recovery release, run 26000896601, reproduced the same PGO failure and then succeeded with the workflow's non-PGO fallback:
Image: windows-11-arm64
Version: 20260510.38.1
rustc 1.95.0 (59807616e 2026-04-14)
host: aarch64-pc-windows-msvc
LLVM version: 22.1.2
==> 2/3 training run — the §AR-benchmarks workload
scripts/pgo-build.sh: line 66: 1371 Segmentation fault "$grund" list "$repo" > /dev/null 2>&1
scripts/pgo-build.sh: line 66: 1372 Segmentation fault "$grund" show FS-check --brief "$repo" > /dev/null 2>&1
...
warning: C:/a/grund/grund/target/pgo-data/default_15662148217428528836_0.profraw: malformed instrumentation profile data: symbol name is empty
warning: C:/a/grund/grund/target/pgo-data/default_6987841190259789436_0.profraw: malformed instrumentation profile data: symbol name is empty
warning: C:/a/grund/grund/target/pgo-data/default_2211884963031461884_0.profraw: malformed instrumentation profile data: symbol name is empty
error: no profile can be merged
Build LTO release binary fallback:
cargo build --release --locked
Finished `release` profile [optimized] target(s) in 44.33s
Additional notes
- The repo has no Windows-active
unsafein this path. The onlyunsafefound is a Unix-onlySIGPIPErestore guarded by#[cfg(unix)]. - The non-PGO fallback binary built immediately after the PGO failure passed the repo self-check in CI.
- I searched for existing reports in
rust-lang/rustandllvm/llvm-projectwith terms aroundaarch64-pc-windows-msvc,profile-generate,segfault,malformed instrumentation profile data, andsymbol name is empty, and did not find an obvious duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure on aarch64-pc-windows-msvc using scripts/pgo-build.sh and the direct -Cprofile-generate command in the issue. Compare the instrumented training run with the successful cargo build --release --locked fallback, then inspect the llvm-profdata output. Done means the PGO binary completes training without segfaults and produces valid .profraw data that can be merged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100