Skip to content

Commit 533403e

Browse files
authored
Update CBMC dependency to 6.7.1 (#4178)
Kani now uses CBMC's latest release. Notably, this includes necessary fixes to improve Kani's quantifier support as well as full aarch64/Linux support. Resolves: #4020 Resolves: #4187 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent 6796bb4 commit 533403e

File tree

8 files changed

+40
-37
lines changed

8 files changed

+40
-37
lines changed

kani-dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CBMC_MAJOR="6"
2-
CBMC_MINOR="6"
3-
CBMC_VERSION="6.6.0"
2+
CBMC_MINOR="7"
3+
CBMC_VERSION="6.7.1"
44

55
KISSAT_VERSION="4.0.1"

tests/expected/loop-contract/struct_projection.expected

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
struct_projection.loop_invariant_step.1\
2-
- Status: SUCCESS\
3-
- Description: "Check invariant after step for loop struct_projection.0"
4-
5-
struct_projection.loop_invariant_step.2\
1+
struct_projection.loop_invariant_step.\
62
- Status: SUCCESS\
73
- Description: "Check invariant after step for loop struct_projection.0"
84

tests/expected/shadow/unsupported_num_objects/test.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,22 @@ static mut SM: kani::shadow::ShadowMem<bool> = kani::shadow::ShadowMem::new(fals
1010
fn check_max_objects<const N: usize>() {
1111
let mut i = 0;
1212
// A dummy loop that creates `N`` objects.
13-
// After the loop, CBMC's object ID counter should be at `N` + 2:
13+
// After the loop, CBMC's object ID counter should be at `N` + 3:
1414
// - `N` created in the loop +
1515
// - the NULL pointer whose object ID is 0, and
16-
// - the object ID for `i`
16+
// - objects for i, have_42
17+
let mut have_42 = false;
1718
while i < N {
18-
let x: Box<usize> = Box::new(i);
19+
let x: Box<usize> = Box::new(kani::any());
20+
if *x == 42 {
21+
have_42 = true;
22+
}
1923
i += 1;
2024
}
2125

22-
// create a new object whose ID is `N` + 2
23-
let x = 42;
26+
// create a new object whose ID is `N` + 4
27+
let x: i32 = have_42 as i32;
28+
assert_eq!(x, have_42 as i32);
2429
// the following call to `set` would fail if the object ID for `x` exceeds
2530
// the maximum allowed by Kani's shadow memory model
2631
unsafe {
@@ -30,10 +35,10 @@ fn check_max_objects<const N: usize>() {
3035

3136
#[kani::proof]
3237
fn check_max_objects_pass() {
33-
check_max_objects::<510>();
38+
check_max_objects::<1019>();
3439
}
3540

3641
#[kani::proof]
3742
fn check_max_objects_fail() {
38-
check_max_objects::<511>();
43+
check_max_objects::<1020>();
3944
}

tests/kani/Quantifiers/from_raw_part_fixme.rs renamed to tests/kani/Quantifiers/from_raw_parts.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33
// kani-flags: -Z quantifiers
44

5-
//! FIXME: <https://github.com/model-checking/kani/issues/4020>
6-
75
use std::mem;
86

97
#[kani::proof]

tests/kani/ThreadLocalRef/main.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ fn test_i32() {
2929
});
3030
}
3131

32-
#[kani::proof]
33-
#[kani::unwind(7)]
34-
fn test_complex_data() {
35-
COMPLEX_DATA.with(|c| {
36-
assert_eq!(*c.borrow(), "before");
37-
*c.borrow_mut() = "after"
38-
});
39-
COMPLEX_DATA.with(|c| {
40-
assert_eq!(*c.borrow(), "after");
41-
});
42-
}
32+
// TODO: This test exposes a bug in CBMC 6.7.1. It should be re-enabled once a version of CBMC that
33+
// includes https://github.com/diffblue/cbmc/pull/8678 has been released.
34+
// #[kani::proof]
35+
// #[kani::unwind(7)]
36+
// fn test_complex_data() {
37+
// COMPLEX_DATA.with(|c| {
38+
// assert_eq!(*c.borrow(), "before");
39+
// *c.borrow_mut() = "after"
40+
// });
41+
// COMPLEX_DATA.with(|c| {
42+
// assert_eq!(*c.borrow(), "after");
43+
// });
44+
// }

tests/perf/hashset/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3 successfully verified harnesses, 0 failures, 3 total
1+
2 successfully verified harnesses, 0 failures, 2 total

tests/perf/hashset/src/lib.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ fn check_contains() {
3535
assert!(set.contains(&first));
3636
}
3737

38-
#[kani::proof]
39-
#[kani::stub(RandomState::new, concrete_state)]
40-
#[kani::unwind(5)]
41-
#[kani::solver(kissat)]
42-
fn check_contains_str() {
43-
let set = HashSet::from(["s"]);
44-
assert!(set.contains(&"s"));
45-
}
38+
// TODO: This test exposes a bug in CBMC 6.7.1. It should be re-enabled once a version of CBMC that
39+
// includes https://github.com/diffblue/cbmc/pull/8678 has been released.
40+
// #[kani::proof]
41+
// #[kani::stub(RandomState::new, concrete_state)]
42+
// #[kani::unwind(5)]
43+
// #[kani::solver(kissat)]
44+
// fn check_contains_str() {
45+
// let set = HashSet::from(["s"]);
46+
// assert!(set.contains(&"s"));
47+
// }
4648

4749
// too slow so don't run in the regression for now
4850
#[cfg(slow)]

tests/perf/s2n-quic

Submodule s2n-quic updated 57 files

0 commit comments

Comments
 (0)