-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Nightly - LLVM code coverage - Issue with generating code coverage when using Prometheus crate #79645
Comments
We should try this again with the changes in PR #79109, which should be landing into nightly soon (a day or two?) |
@richkadel - I've retried with |
@BenChand - Great! Feel free to close this issue if you are satisfied. Thanks! |
A day ago we started to get this error again |
@wesleywiser I assume this is related to your recent change. We should review the thread and see if there's a clue as to why the regression. |
@gkorland are you seeing this with the Prometheus crate or some other crate? |
Can't speak for @gkorland, however I'm also seeing this on the PyO3 CI: https://github.com/PyO3/pyo3/runs/4833765075?check_suite_focus=true |
@wesleywiser - I downloaded the original test case mentioned at the top of this issue, and confirmed I get the error message. Unfortunately, as we've seen with similar error messages from the LLVM CoverageMappingReader, the message is almost useless. It's generated when the code calls It looks like this specific message is generated when CoverageMappingReader expects some data that is not there. It's not clear what change in #79109 fixed this problem. That was a large PR that addressed many things in rust coverage, when I was in the thick of developing it. But I see one commit (within a rebased, combined commit) in that PR that says:
Based on your change in #92142, my guess (but still very much a guess) is this change may have fixed the original issue, and your change very likely could have reverted this solution. There is a lot of cross-referencing in the LLVM-IR between variables that point to the coverage mapping data and variables that point to the actual functions, within the same module. Since you tried to put all unused functions in the same module, perhaps the coverage mapping data is in a different module than the function definition? (I don't think that's the case, but worth double checking.) Or maybe the module you picked is getting garbage collected/dropped at link time in this case. (I think we talked about this possibility.) I tried adding |
Just wanted to say thank you for working on coverage in general @richkadel @wesleywiser - the quality of coverage measurements in PyO3 keep getting better and better, and I'm looking forward to having |
I can confirm that I am also able to see the same issue using latest nightly toolchain |
hitting that issue too o.o |
#93144 was just merged a few hours ago and should resolve these issues. It should be available in the next nightly toolchain release. If you run into further issues, please open a new issue so we can make sure it gets resolved appropriately. Thanks! |
I've been encountering a problem with generating code coverage for a project that uses the crate prometheus, specifically versions 0.9 onwards. Using these versions of the prometheus crate results in the error Failed to load coverage: Truncated coverage data when attempting to build the final coverage report. I've attempted to generalize the problem into a small test project here:
https://github.com/BenChand/prometheus-code-cov
I'm currently using nightly-2020-11-25. I've also listed 3 ways that I am able to get code coverage working in that example project when I change parts related to the prometheus crate.
I've tried with these versions of LLVM:
11.0.0-rust-1.50.0-nightly
11.0.1
Expected:
Instead, this happened:
Meta
Rust version:
nightly-2020-11-25
@richkadel
The text was updated successfully, but these errors were encountered: