-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix coverage ICEs (unreachable-cov-only, spanview wrong body) #85082
Conversation
Fixes: rust-lang#85081 An `assert!()` in `FunctionCoverage` failed, because PR rust-lang#84797 replaces unreachable `Counter`s with `Unreachable` code regions to be added to the function's coverage map. To fix it, and still generate valid LLVM coverage IR, convert one unreachable to a `Counter`.
@wesleywiser - Since the change that causes the ICE is probably in I'm sorry I don't have a new test to include with this fix. I don't know how to create an example that leads to this situation. I only know that I've confirmed this solution works for the complicated code that triggered it. (It's clear why this happens, and it was my oversight not to have recognized the flaw in the original PR.) Thanks. |
The coverage body_span doesn't always match the function body_span.
This comment has been minimized.
This comment has been minimized.
Some code cleanup extracted from future (but unfinished) commit to fix coverage in attr macro functions.
I moved the attr macro code to #85173 |
Closing this PR in lieu of #85215. |
…ks, r=tmandry coverage bug fixes and some refactoring This replaces the relevant commits (2 and 3) from PR rust-lang#85082, and also corrects an error querying for coverageinfo. 1. `coverageinfo` query needs to use the same MIR as codegen I ran into an error trying to fix dead block coverage and realized the `coverageinfo` query is getting a different MIR compared to the codegenned MIR, which can sometimes be a problem during mapgen. I changed that query to use the `InstandeDef` (which includes the generic parameter substitutions, prosibly specific to const params) instead of the `DefId` (without unknown/default const substitutions). 2. Simplified body_span and filtered span code Some code cleanup extracted from future (but unfinished) commit to fix coverage in attr macro functions. 3. Spanview needs the relevant body_span used for coverage The coverage body_span doesn't always match the function body_span. r? `@tmandry`
…ks, r=tmandry coverage bug fixes and some refactoring This replaces the relevant commits (2 and 3) from PR rust-lang#85082, and also corrects an error querying for coverageinfo. 1. `coverageinfo` query needs to use the same MIR as codegen I ran into an error trying to fix dead block coverage and realized the `coverageinfo` query is getting a different MIR compared to the codegenned MIR, which can sometimes be a problem during mapgen. I changed that query to use the `InstandeDef` (which includes the generic parameter substitutions, prosibly specific to const params) instead of the `DefId` (without unknown/default const substitutions). 2. Simplified body_span and filtered span code Some code cleanup extracted from future (but unfinished) commit to fix coverage in attr macro functions. 3. Spanview needs the relevant body_span used for coverage The coverage body_span doesn't always match the function body_span. r? ``@tmandry``
…ks, r=tmandry coverage bug fixes and some refactoring This replaces the relevant commits (2 and 3) from PR rust-lang#85082, and also corrects an error querying for coverageinfo. 1. `coverageinfo` query needs to use the same MIR as codegen I ran into an error trying to fix dead block coverage and realized the `coverageinfo` query is getting a different MIR compared to the codegenned MIR, which can sometimes be a problem during mapgen. I changed that query to use the `InstandeDef` (which includes the generic parameter substitutions, prosibly specific to const params) instead of the `DefId` (without unknown/default const substitutions). 2. Simplified body_span and filtered span code Some code cleanup extracted from future (but unfinished) commit to fix coverage in attr macro functions. 3. Spanview needs the relevant body_span used for coverage The coverage body_span doesn't always match the function body_span. r? ```@tmandry```
Fixes: #85081
An
assert!()
inFunctionCoverage
failed, because PR #84797replaces unreachable
Counter
s withUnreachable
code regions to beadded to the function's coverage map.
To fix it, and still generate valid LLVM coverage IR, convert one
unreachable to a
Counter
.This PR includes two additional commits:
r? @tmandry
cc: @wesleywiser