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

Confusing coverage result: Uncovered end of block on if statement #3455

Open
adpaco-aws opened this issue Aug 20, 2024 · 0 comments
Open

Confusing coverage result: Uncovered end of block on if statement #3455

adpaco-aws opened this issue Aug 20, 2024 · 0 comments
Labels
[C] Bug This is a bug. Something isn't working. [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. [F] Spurious Failure Issues that cause Kani verification to fail despite the code being correct. Z-UnstableFeature Issues that only occur if a unstable feature is enabled

Comments

@adpaco-aws
Copy link
Contributor

We noticed a confusing coverage result in #3119 where, for the code

#[kani::proof]
fn main() {
    let x: u32 = kani::any_where(|val| *val == 5);
    if x > 3 {
        assert!(x > 4);
    }
}

we get the result

Source-based code coverage results:

test.rs (main)\
 * 5:1 - 6:34 COVERED\
 * 7:14 - 9:6 COVERED\
 * 9:6 - 9:7 UNCOVERED

test.rs (main::{closure#0})\
 * 6:40 - 6:49 COVERED

It's not clear to me why this is happening. It's also strange that no region is associated to if x > 3 here. Maybe it's due to an artifact introduced by the closure?

@adpaco-aws adpaco-aws added the [C] Bug This is a bug. Something isn't working. label Aug 20, 2024
@adpaco-aws adpaco-aws added [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. [F] Spurious Failure Issues that cause Kani verification to fail despite the code being correct. Z-UnstableFeature Issues that only occur if a unstable feature is enabled labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working. [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. [F] Spurious Failure Issues that cause Kani verification to fail despite the code being correct. Z-UnstableFeature Issues that only occur if a unstable feature is enabled
Projects
None yet
Development

No branches or pull requests

1 participant