rust-lang / rust-lang/rust

[aarch64-pc-windows-msvc] Coverage instrumentation produces malformed profile

Open
#150,123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-code-coverage C-bug O-aarch64-pc-windows-msvc T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I am encountering a coverage generation failure specifically on the newly promoted Tier 1 target aarch64-pc-windows-msvc.

Steps

Here are the verified reproduction steps (PowerShell on Windows ARM64 with Build Tools for Visual Studio installed):

  1. Setup Toolchain:

    rustup default nightly-2025-12-17
    rustup component add llvm-tools-preview
    
  2. Create Project & Build:

    cargo new reproduction
    cd reproduction
    $Env:RUSTFLAGS="-C instrument-coverage"
    cargo build
    $Env:LLVM_PROFILE_FILE="default.profraw"
    ./target/debug/reproduction.exe
    
  3. Process Coverage (Fails):

    $LLVM_BIN = "$(Split-Path (rustc --print target-libdir) -Parent)\bin"
    & "$LLVM_BIN\llvm-profdata.exe" merge -sparse default.profraw -o default.profdata
    
Expected Behavior

llvm-profdata should successfully merge the profile data.

Actual Behavior

llvm-profdata fails with:

warning: default.profraw: malformed instrumentation profile data: symbol name is empty
error: no profile can be merged
Version
rustc 1.94.0-nightly (f794a0873 2025-12-17)
host: aarch64-pc-windows-msvc
Additional Context

The "function name is empty" error from CoverageMappingReader typically indicates a lookup failure where the function name cannot be found in the symbol table for a corresponding hash in the coverage metadata (https://github.com/rust-lang/rust/issues/141577#issuecomment-3121149059).

This currently blocks coverage collection on the new windows-11-arm GitHub Actions runners. Here is the GitHub Actions workflow job that reproduces the issue:

jobs:
  reproduction:
    name: Issue reproduction
    permissions: {}
    runs-on: windows-11-arm
    steps:      
      - name: Setup MSVC developer command prompt
        if: runner.os == 'Windows'
        uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
      
      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
        with:
          toolchain: 'nightly-2025-12-17'
          components: 'llvm-tools-preview'

      - name: Create reproduction project
        shell: pwsh
        run: |
          cargo new reproduction

      - name: Generate coverage data
        shell: pwsh
        working-directory: reproduction
        env:
          RUSTFLAGS: '-C instrument-coverage'
          LLVM_PROFILE_FILE: 'default.profraw'
        run: |
          cargo build
          ./target/debug/reproduction.exe

      - name: Process coverage data
        shell: pwsh
        working-directory: reproduction
        run: |
          $LLVM_BIN = "$(Split-Path (rustc --print target-libdir) -Parent)\bin"
          & "$LLVM_BIN\llvm-profdata.exe" merge -sparse default.profraw -o default.profdata

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the PowerShell reproduction on the aarch64-pc-windows-msvc target and inspect the CoverageMappingReader context mentioned in the report. Compare the generated default.profraw with a working target and use llvm-profdata merge as the validation step; done means the profile merges without the empty-symbol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
ci-cd, compilers, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.