Skip to content

Instrumentation profile data contains empty function name (?) as of nightly-2025-05-19 #141577

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

Open
jan-ferdinand opened this issue May 26, 2025 · 12 comments
Assignees
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jan-ferdinand
Copy link
Contributor

jan-ferdinand commented May 26, 2025

Hi there! I hope I'm using the right issue template and the right repository; apologies if I'm not. Happy about pointers to improve on that.
Also, the issue's title might be arbitrarily far from what's actually going on.

Code

I tried to run the following command on this crate:

cargo llvm-cov

I expected to see this happen: successful generation of a coverage report, for example like in this workflow run.

Instead, this happened: error “malformed instrumentation profile data: function name is empty”, for example like in this workflow run.

I can reproduce the error locally, so I'm reasonably sure that it's not CI's fault.

Version it worked on

rustc --version --verbose:

rustc 1.89.0-nightly (4d051fb30 2025-05-18)
binary: rustc
commit-hash: 4d051fb306e661654d088892e02e69b8c0c39d43
commit-date: 2025-05-18
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Version with regression

rustc --version --verbose:

rustc 1.89.0-nightly (60dabef95 2025-05-19)
binary: rustc
commit-hash: 60dabef95a3de3ec974dcb50926e4bfe743f078f
commit-date: 2025-05-19
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

I have tried to run cargo-bisect-rustc but can't get the installation of the component llvm-tools-preview to work there, since the toolchain bisect-* seems to be throwing something off. 😕

@jan-ferdinand jan-ferdinand added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels May 26, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 26, 2025
@jieyouxu jieyouxu added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label May 26, 2025
@apiraino
Copy link
Contributor

apiraino commented May 26, 2025

@jan-ferdinand thanks for filing this issue. is it possible to reproduce the issue without having the code in that repository connect to external services?

Details

2025-05-26T11:00:46.407357Z DEBUG neptune_cash::tests::shared: cannot open file 'test_data/6770875a59dc73f6c82631f771c44db8ce2444a71c3eacdb66e337be1e2a8ab3440f365c8449f85f.proof' -- might not exist
2025-05-26T11:00:46.407372Z DEBUG neptune_cash::models::proof_abstractions::tasm::program::tests: Proof not found on disk.
2025-05-26T11:00:46.407590Z DEBUG neptune_cash::tests::shared: requesting: <http://explorer.neptune.cash:42580/6770875a59dc73f6c82631f771c44db8ce2444a71c3eacdb66e337be1e2a8ab3440f365c8449f85f.proof>
http://explorer.neptune.cash:42580/ responded with 404 Not Found
2025-05-26T11:00:46.913707Z DEBUG neptune_cash::tests::shared: requesting: <http://neptunefundamentals.org:42580/6770875a59dc73f6c82631f771c44db8ce2444a71c3eacdb66e337be1e2a8ab3440f365c8449f85f.proof>
got proof.

Note, for info: llvm-cov is a separate project hosted at https://github.com/taiki-e/cargo-llvm-cov

@rustbot label +E-needs-bisection +E-needs-mcve

@rustbot rustbot added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels May 26, 2025
@bjorn3
Copy link
Member

bjorn3 commented May 26, 2025

Same issue with zlib-rs: trifectatechfoundation/zlib-rs#368 cc @folkertdev

@jan-ferdinand
Copy link
Contributor Author

is it possible to reproduce the issue without having the code in that repository connect to external services?

Apologies! It is possible, yes:

works: cargo +nightly-2025-05-19 llvm-cov -- database::storage::storage_schema::dbtvec::tests::streams::stream_many
doesn't work: cargo +nightly-2025-05-20 llvm-cov -- database::storage::storage_schema::dbtvec::tests::streams::stream_many

Note, for info: llvm-cov is a separate project hosted at taiki-e/cargo-llvm-cov

Thanks for pointing this out explicitly. The reason I opened the issue here is that, as far as I can tell, the same version of llvm-cov is being used in both the working and the failing command. If you think the issue belongs with llvm-cov, I can move the discussion there.

jan-ferdinand added a commit to Neptune-Crypto/neptune-core that referenced this issue May 26, 2025
Due to a regression (?) in the rustc compiler, the code coverage
workflow has been failing since 2025-05-20. Temporarily use a version of
nightly that is known to work, until rust-lang/rust#141577 (or whatever
replaces it) is resolved.
jan-ferdinand added a commit to Neptune-Crypto/neptune-core that referenced this issue May 26, 2025
Due to a regression (?) in the rustc compiler, the code coverage
workflow has been failing since 2025-05-20. Temporarily use a version of
nightly that is known to work, until rust-lang/rust#141577 (or whatever
replaces it) is resolved.
@folkertdev
Copy link
Contributor

I would guess #141063 is the cause?

@jan-ferdinand
Copy link
Contributor Author

jan-ferdinand commented May 27, 2025

I would guess #141063 is the cause?

According to rustc --version --verbose, both the working and the failing command use the same version of LLVM, namely 20.1.5.

$ diff -u fails works
-rustc 1.89.0-nightly (60dabef95 2025-05-19)
+rustc 1.89.0-nightly (4d051fb30 2025-05-18)
 binary: rustc
-commit-hash: 60dabef95a3de3ec974dcb50926e4bfe743f078f
-commit-date: 2025-05-19
+commit-hash: 4d051fb306e661654d088892e02e69b8c0c39d43
+commit-date: 2025-05-18
 host: x86_64-unknown-linux-gnu
 release: 1.89.0-nightly
 LLVM version: 20.1.5

@folkertdev
Copy link
Contributor

Maybe #140847 then (cc @Zalathar does that seem plausible)?

I can't reproduce the issue locally, we're only seeing it on CI. @jan-ferdinand what is your problem with cargo bisect-rustc? Maybe you could use a custom script and run e.g. this to install the right llvm-cov?

rustup +nightly-2025-05-19-x86_64-unknown-linux-gnu component add llvm-tools-preview

@bjorn3
Copy link
Member

bjorn3 commented May 27, 2025

You can pass -c llvm-tools-preview to cargo bisect-rustc to tell it to install this component for every toolchain it downloads.

@jan-ferdinand
Copy link
Contributor Author

jan-ferdinand commented May 27, 2025

I can't reproduce the issue locally

That's a bummer, @folkertdev. Do you have any idea how I could help you out here?

edit: Oh, I might have misunderstood what you're saying. Are you saying that you cannot reproduce trifectatechfoundation/zlib-rs#368 locally?

what is your problem with cargo bisect-rustc?

  • The toolchain set by bisect-rustc is bisect-nightly-_, and I don't know how to teach rustup that the bisect- prefix should be ignored when I tell it to install a component. It keeps telling me that I'm supplying an invalid toolchain name, which… yeah, I am. My assumption is that simply trimming the prefix myself installs the component for a different toolchain than the bisect-_ one. Perhaps that's an incorrect assumption?
  • I thought about using a custom script. However, from my understanding, such scripts should not set the toolchain themselves but rather rely on bisect-rustc's overrides. My intuition tells me that doing rustup +my-toolchain in the custom script would interfere with the bisection process. This understanding could be arbitrarily flawed. Is your suggestion a good way forward?

You can pass -c llvm-tools-preview to cargo bisect-rustc to tell it to install this component for every toolchain it downloads.

That sounds useful, @bjorn3.1 Unfortunately, I can't get it to work. Apparently, the requested version of the toolchain could not be found. I'm assuming it means that the requested component could not be found? The same is true if I try different dates for --start. I want back as far as 2025-05-15 and then concluded that it's a systematic problem.

Console Dump
❯ cargo bisect-rustc -c llvm-tools-preview --start=2025-05-19 --end=2025-05-20 -- llvm-cov -- database::storage::storage_schema::dbtvec::tests::streams::stream_many
checking the start range to find a passing nightly
installing nightly-2025-05-19
cargo-nightly-x86_64-unknown-linux-gnu: 9.55 MB / 9.55 MB
…
uninstalling nightly-2025-05-19
*** unable to install nightly-2025-05-19. roll back one day and try again...
ERROR: could not find nightly-2025-05-19

Omitting the -c llvm-tools-preview results in a compilation error. It makes sense to me that something fails if a required component is missing.

Console Dump
❯ cargo bisect-rustc --start=2025-05-19 --end=2025-05-20 -- llvm-cov -- database::storage::storage_schema::dbtvec::tests::streams::stream_many
checking the start range to find a passing nightly
installing nightly-2025-05-19
rust-std-nightly-x86_64-unknown-linux-gnu: …
RESULT: nightly-2025-05-19, ===> Compile error
uninstalling nightly-2025-05-19

ERROR: the start of the range (nightly-2025-05-19) must not reproduce the regression

Footnotes

  1. Is there a secret piece of documentation flying around other than the cargo-bisect-rustc book?

@Zalathar
Copy link
Contributor

Maybe #140847 then (cc @Zalathar does that seem plausible)?

It would be weird, but not completely implausible.

Given the circumstances, I think I'll try a revert.

@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 27, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 27, 2025
… r=Zalathar

coverage: Revert "unused local file IDs" due to empty function names

The changes to coverage metadata generation in rust-lang#140847 appear to be the most likely cause of the `function name is empty` errors reported in rust-lang#141577.

If that guess is correct, great. If not, no big deal.

---

This reverts commit 3b22c21, reversing changes made to 5f292ee.

r? ghost
rust-timer added a commit that referenced this issue May 27, 2025
Rollup merge of #141650 - Zalathar:revert-unused-local-file, r=Zalathar

coverage: Revert "unused local file IDs" due to empty function names

The changes to coverage metadata generation in #140847 appear to be the most likely cause of the `function name is empty` errors reported in #141577.

If that guess is correct, great. If not, no big deal.

---

This reverts commit 3b22c21, reversing changes made to 5f292ee.

r? ghost
@Zalathar
Copy link
Contributor

The revert has been merged (#141650), so hopefully the failure will disappear in the next nightly. Please let me know whether or not that's the case.

That said, I do intend to re-land similar changes at some point in the future. So without a self-contained repro (or at least knowing what actually happened here), there is a risk that this will break again.

github-actions bot pushed a commit to rust-lang/miri that referenced this issue May 28, 2025
coverage: Revert "unused local file IDs" due to empty function names

The changes to coverage metadata generation in rust-lang/rust#140847 appear to be the most likely cause of the `function name is empty` errors reported in rust-lang/rust#141577.

If that guess is correct, great. If not, no big deal.

---

This reverts commit 3b22c21dd8c30f499051fe7a758ca0e5d81eb638, reversing changes made to 5f292eea6d63abbd26f1e6e00a0b8cf21d828d7d.

r? ghost
@apiraino
Copy link
Contributor

thanks @Zalathar

I'll assign this issue to you for further investigation (but feel free to re-assign or just unassign)

@rustbot assign @Zalathar

@folkertdev
Copy link
Contributor

Looks like the revert did indeed fix the issue, zlib-rs CI is passing again https://github.com/trifectatechfoundation/zlib-rs/actions/runs/15338976180.

zlib-rs is happy to be the canary in the coalmine here for future changes (that's kind of what nightly is for). I've still not been able to reproduce the issue locally, maybe @jan-ferdinand can make a smaller reproducing example?

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. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-untriaged Untriaged performance or correctness regression. 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

7 participants