Skip to content

Regression in 2024-11-28: llvm-cov export errors with "truncated coverage data" #133606

@alex

Description

@alex
Member

Code

Beginning with today's nightly, processing coverage produced by rustc binaries fails. Here is an example CI run: https://github.com/pyca/cryptography/actions/runs/12077661037/job/33681030705?pr=12066

The relevant snippet:

nox > /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov export /home/runner/work/cryptography/cryptography/.nox/tests/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so -instr-profile=rust-cov.profdata '--ignore-filename-regex=[/\].cargo[/\]' '--ignore-filename-regex=[/\]rustc[/\]' '--ignore-filename-regex=[/\].rustup[/\]toolchains[/\]' '--ignore-filename-regex=[/\]target[/\]' --format=lcov
nox > Command /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov export /home/runner/work/cryptography/cryptography/.nox/tests/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so -instr-profile=rust-cov.profdata '--ignore-filename-regex=[/\].cargo[/\]' '--ignore-filename-regex=[/\]rustc[/\]' '--ignore-filename-regex=[/\].rustup[/\]toolchains[/\]' '--ignore-filename-regex=[/\]target[/\]' --format=lcov failed with exit code 1:
error: failed to load coverage: '/home/runner/work/cryptography/cryptography/.nox/tests/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so': truncated coverage data
error: could not load coverage information

#133418 is the only change in the regression range with a commit message mentioning coverage. cc: @Zalathar

Happy Thanksgiving!

Version it worked on

rustc 1.85.0-nightly (6b6a867ae 2024-11-27)

Version with regression

rustc 1.85.0-nightly (a2545fd6f 2024-11-28)

Activity

added
C-bugCategory: This is a bug.
regression-untriagedUntriaged performance or correctness regression.
on Nov 29, 2024
added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
and removed
regression-untriagedUntriaged performance or correctness regression.
on Nov 29, 2024
added
A-doc-coverageArea: Calculating how much of a crate has documentation
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
and removed
A-doc-coverageArea: Calculating how much of a crate has documentation
on Nov 29, 2024
Zalathar

Zalathar commented on Nov 29, 2024

@Zalathar
Contributor

Hmm, my guess is that 619a272 is making it possible for all of a CGU's functions to be discarded at a late stage, so parts of the metadata end up being empty in a way that the llvm-cov isn't happy with.

Finding and testing a fix is probably going to be non-trivial (especially without a small repro), so for now it's probably wisest to revert.

alex

alex commented on Nov 29, 2024

@alex
MemberAuthor

Regrettably, I don't have a reproducer smaller than "our entire large project with a bunch of deps" :-(

added a commit that references this issue on Nov 29, 2024

4 remaining items

added 2 commits that reference this issue on Nov 29, 2024
jieyouxu

jieyouxu commented on Nov 29, 2024

@jieyouxu
Member

Revert PR #133608 landed.

arnodb

arnodb commented on Nov 29, 2024

@arnodb

Hi!

It's not minimized but https://github.com/arnodb/quirky_binder/actions/runs/12090701392/job/33718146447 faces exactly this problem.

It occurs with a build script. Unfortunately it's one of the last modules of the workspace to compile.

Commit 7c0ae33c25363b8b4637bb6501e10f2d2117f24c crashes but it is also possible that other commits crash in the same way.

Hope this helps.

apiraino

apiraino commented on Dec 2, 2024

@apiraino
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

added and removed
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Dec 2, 2024
Zalathar

Zalathar commented on Dec 2, 2024

@Zalathar
Contributor

The revert has landed and seems to have fixed the regression, so closing as fixed.

(I'll need to be mindful of this failure when working on a new version of #133418.)

added a commit that references this issue on Dec 19, 2024
57cbd07
added a commit that references this issue on Dec 20, 2024
Zalathar

Zalathar commented on Dec 20, 2024

@Zalathar
Contributor

A new version of the original PR has been merged in #134497, and will be included in the next nightly.

Based on my testing, I believe that this issue should not reoccur, but let me know if something does go wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alex@apiraino@arnodb@Zalathar@jieyouxu

        Issue actions

          Regression in 2024-11-28: llvm-cov export errors with "truncated coverage data" · Issue #133606 · rust-lang/rust