Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alex opened this issue Nov 29, 2024 · 7 comments
Closed
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alex
Copy link
Member

alex commented Nov 29, 2024

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)

@alex alex added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Nov 29, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-untriaged Untriaged performance or correctness regression. labels Nov 29, 2024
@jieyouxu jieyouxu added A-doc-coverage Area: Calculating how much of a crate has documentation A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed A-doc-coverage Area: Calculating how much of a crate has documentation labels Nov 29, 2024
@Zalathar
Copy link
Contributor

Zalathar commented Nov 29, 2024

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
Copy link
Member Author

alex commented Nov 29, 2024

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

Zalathar added a commit to Zalathar/rust that referenced this issue Nov 29, 2024
This reverts commit adf9b5f, reversing
changes made to af1ca15.

Reverting due to <rust-lang#133606>.
@Zalathar
Copy link
Contributor

Yeah, minimizing this sort of coverage regression is annoying, so I generally don't expect issue reporters to do it themselves.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 29, 2024
Zalathar added a commit to Zalathar/rust that referenced this issue Nov 29, 2024
Revert rust-lang#133418 (Store coverage source regions as `Span`) due to regression rust-lang#133606

This reverts commit adf9b5f, reversing changes made to af1ca15.

Reverting rust-lang#133418 due to regressions reported at rust-lang#133606.

r? jieyouxu
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 29, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#131323 (Support `clobber_abi` in AVR inline assembly)
 - rust-lang#133092 (Always set the deployment target when building std)
 - rust-lang#133134 (Don't use a SyntheticProvider for literally every type)
 - rust-lang#133538 (Better diagnostic for fn items in variadic functions)
 - rust-lang#133590 (Rename `-Zparse-only`)
 - rust-lang#133592 (Misc: better instructions for envrc, ignore `/build` instead of `build/`)
 - rust-lang#133608 (Revert rust-lang#133418 (Store coverage source regions as `Span`) due to regression rust-lang#133606)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 29, 2024
Revert rust-lang#133418 (Store coverage source regions as `Span`) due to regression rust-lang#133606

This reverts commit adf9b5f, reversing changes made to af1ca15.

Reverting rust-lang#133418 due to regressions reported at rust-lang#133606.

r? jieyouxu
@jieyouxu
Copy link
Member

Revert PR #133608 landed.

@arnodb
Copy link

arnodb commented Nov 29, 2024

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
Copy link
Contributor

apiraino commented Dec 2, 2024

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 2, 2024
@Zalathar
Copy link
Contributor

Zalathar commented Dec 2, 2024

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.)

@Zalathar Zalathar closed this as completed Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants