-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Our last ICE before we get coverage working #78286
Comments
@richkadel might be interested in this?
I don't know how much help this report is... but I appreciate all the work you've been doing. |
@gilescope you said the original code is private - could you put together a minimal reproduction? |
That's a very good question. Not sure - it's not that minimal at the moment.. on the plus side this issue is affecting 1% of the tests, so we're really very close to everything working... tcx.sess.opts.debugging_opts.instrument_coverage - it looks like the code thought coverage was not turned on but then later it tried to log some coverage. |
My best guess is you have a library compiled with coverage and are compiling a binary without the -Zinstrument-coverage flag. The coverage statements in the library are encountered during codegen, which assumes coverage is enabled. Assuming this is the scenario, this should be an easy fix. I'll put a PR together. FYI @wesleywiser @tmandry |
Addresses Issue rust-lang#78286 Libraries compiled with coverage and linked with out enabling coverage would fail when attempting to add the library's coverage statements to the codegen coverage context (None). Now, if coverage statements are encountered while compiling / linking with `-Z instrument-coverage` disabled, codegen will *not* attempt to add code regions to a coverage map, and it will not inject the LLVM instrprof_increment intrinsic calls.
@gilescope I think the PR I just uploaded should fix this issue. @wesleywiser - I hope you don't mind, I set you as the reviewer. OK? |
@richkadel Yep, totally fine! |
@gilescope The proposed fix has been merged. Can you rebase and retest and verify this resolves the issue? |
I'd love to be in a position to tell you if it works or not but because of reasons I can't give you a definitive answer one way or another at the moment. The changes look good to me though - much appreciated and apologies I can't give you a definite answer yet. |
Ok, I understand. Should we close this issue and reopen a new issue if the problem returns? |
Yes I think best close this - thanks very much for the fix. |
Thanks for all the work you've recently been doing to coverage - we seem to have one last hurdle before all our tests (closed source) pass with coverage enabled. (yes we use proc macros)
RUSTCFLAGS = -Zinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off
CARGO_INCREMENTAL=0
RUSTDOCFLAGS=-Cpanic=abort
cargo test --message-format=json -Ztimings=json,html,info -- -Zunstable-options --format json
The text was updated successfully, but these errors were encountered: