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

Concrete playback should support all kind of property failures #2163

Open
celinval opened this issue Jan 26, 2023 · 0 comments
Open

Concrete playback should support all kind of property failures #2163

celinval opened this issue Jan 26, 2023 · 0 comments
Assignees
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.

Comments

@celinval
Copy link
Contributor

Requested feature: Concrete playback should generate tests for all kind of failures, even those that trigger a UB.
Use case: Users wanting to debug a failure that is not related to a user assertion, such as invalid memory access, could run the generated test case under valgrind or miri to detect the issue.
Link to relevant documentation (Rust reference, Nomicon, RFC):

Dummy test case:

#[kani::proof]
fn check_len() {
    let mut input = vec!['h', 't'];
    let new_len = kani::any();
    unsafe { input.set_len(new_len) };
    let last = input.pop();
    assert_eq!(last.unwrap(), 't');
}

This test should generate at least 3 different tests. One for our of bound access (e.g.: new_len = 10), one for unwrap() a none object (new_len = 0), and one for the assertion failure (new_len = 1).

For the out of bounds case, the test would likely succeed in a regular execution, but it would fail when running it with MIRI or valgrind.

Note: Since these failures might not be so trivial, we may want a different structure or name schema for them to differentiate from things that should fail in a simple execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants