-
Notifications
You must be signed in to change notification settings - Fork 97
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
Upgrade to CBMC 5.69.1 (with fixes) #1811
Changes from all commits
3d0bb10
d0c177f
f53f57c
3f0c239
c94213a
04bf4ae
4815cd5
d75819b
b5fadab
2b67629
77083fe
38e5f23
9b62f1f
308ee14
2a8e4ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CBMC_VERSION="5.67.0" | ||
CBMC_VERSION="5.69.1" | ||
# If you update this version number, remember to bump it in `src/setup.rs` too | ||
CBMC_VIEWER_VERSION="3.6" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,12 +124,17 @@ impl KaniSession { | |
args.push("--validate-ssa-equation".into()); | ||
} | ||
|
||
if !self.args.visualize | ||
&& self.args.concrete_playback.is_none() | ||
&& !self.args.no_slice_formula | ||
{ | ||
args.push("--slice-formula".into()); | ||
} | ||
// Push `--slice-formula` argument. | ||
// Previously, this would happen if the condition below was satisfied: | ||
// ```rust | ||
// if !self.args.visualize | ||
// && self.args.concrete_playback.is_none() | ||
// && !self.args.no_slice_formula | ||
// ``` | ||
// But for some reason, not pushing it causes a CBMC invariant violation | ||
// since version 5.68.0. | ||
// <https://github.com/model-checking/kani/issues/1810> | ||
args.push("--slice-formula".into()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mess with concrete playback? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs more investigation. My understanding was that using |
||
|
||
if self.args.concrete_playback.is_some() { | ||
args.push("--trace".into()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERIFICATION:- SUCCESSFUL |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,13 @@ | |
#include <stdio.h> | ||
#include <string.h> | ||
|
||
/// Mapping unit to `void` works for functions with no return type but not for | ||
/// variables with type unit. We treat both uniformly by declaring an empty | ||
/// struct type: `struct Unit {}` and a global variable `struct Unit VoidUnit` | ||
/// returned by all void functions (both declared by the Kani compiler). | ||
struct Unit; | ||
extern struct Unit VoidUnit; | ||
|
||
size_t my_add(size_t num, ...) | ||
{ | ||
va_list argp; | ||
|
@@ -48,7 +55,15 @@ struct Foo2 { | |
|
||
uint32_t S = 12; | ||
|
||
void update_static() { S++; } | ||
// Note: We changed the return type from `void` to `struct Unit` when upgrading | ||
// to a newer CBMC version with stricter type-checking. This is a temporary | ||
// change until C-FFI support is added. | ||
// <https://github.com/model-checking/kani/issues/1817> | ||
struct Unit update_static() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something that ought to work once C-FFI is in place. We should have comments and a tracking ticket explaining that this is a workaround we want to remove |
||
{ | ||
S++; | ||
return VoidUnit; | ||
} | ||
|
||
uint32_t takes_int(uint32_t i) { return i + 2; } | ||
|
||
|
@@ -63,7 +78,15 @@ uint32_t takes_ptr_option(uint32_t *p) | |
} | ||
} | ||
|
||
void mutates_ptr(uint32_t *p) { *p -= 1; } | ||
// Note: We changed the return type from `void` to `struct Unit` when upgrading | ||
// to a newer CBMC version with stricter type-checking. This is a temporary | ||
// change until C-FFI support is added. | ||
// <https://github.com/model-checking/kani/issues/1817> | ||
struct Unit mutates_ptr(uint32_t *p) | ||
{ | ||
*p -= 1; | ||
return VoidUnit; | ||
} | ||
|
||
uint32_t name_in_c(uint32_t i) { return i + 2; } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seriously? There is one remaining outlier? Is there an issue open to CBMC about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find one, so I opened diffblue/cbmc#7282 (and pasted the issue there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll comment on the CBMC issue, but indeed rounding mode is different.