Skip to content

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

@vadimpiven

Description

@vadimpiven

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 (#141577 (comment)).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.O-aarch64-pc-windows-msvcTarget: aarch64-pc-windows-msvcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions