Skip to content

Update to CBMC version 6.1.1 - #2995

Merged
tautschnig merged 62 commits into
model-checking:mainfrom
tautschnig:cbmc-6
Jul 31, 2024
Merged

Update to CBMC version 6.1.1#2995
tautschnig merged 62 commits into
model-checking:mainfrom
tautschnig:cbmc-6

Conversation

@tautschnig

@tautschnigtautschnig commented Feb 6, 2024

Copy link
Copy Markdown
Member

Updates to match changes to the GOTO binary format.

Resolves: #2952, #2972, #3287, #3391

This includes changes our handling of storage markers to be marking is-alive only rather than treating StorageLive as creating a new object. That is, object instances are now tied to their Mir-provided declarations (which, at present, only appear once per function). To still account for when Rust scopes deem an object to be alive, we use StorageLive and StorageDead to update __CPROVER_dead_object. This (global) variable is used by CBMC's pointer checks to track when a pointer may not be safe to dereference for it could be pointing to an object that no longer is in scope.

Resolves: #3099

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

Updates to match changes to the GOTO binary format.
Resolves: model-checking#2972
@tautschnigtautschnig self-assigned this Feb 6, 2024
@github-actionsgithub-actionsBot added the Z-EndToEndBenchCI Tag a PR to run benchmark CI label Feb 6, 2024
This changes our handling of storage markers to be marking is-alive
only rather than treating StorageLive as creating a new object. That is,
object instances are now tied to their Mir-provided declarations (which,
at present, only appear once per function). To still account for when
Rust scopes deem an object to be alive, we use StorageLive and
StorageDead to update `__CPROVER_dead_object`. This (global) variable is
used by CBMC's pointer checks to track when a pointer may not be safe to
dereference for it could be pointing to an object that no longer is in
scope.
Resolves: model-checking#3099

@zhassan-awszhassan-aws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this happen!

How does the change in CBMC's default verbosity affect the Kani output? Is the change worth pointing out in the CHANGELOG.md?

Comment threadcprover_bindings/src/env.rs Outdated
Comment threadkani-compiler/src/codegen_cprover_gotoc/context/current_fn.rs Outdated
Comment threadscripts/kani-perf.sh Outdated
Comment threadtests/expected/dead-invalid-access-via-raw/main.expected
Comment threadtools/benchcomp/configs/perf-regression.yaml
@tautschnig

Copy link
Copy Markdown
MemberAuthor

How does the change in CBMC's default verbosity affect the Kani output? Is the change worth pointing out in the CHANGELOG.md?

I think we used to see loop-unwinding information while running Kani, that is now no longer the case. Other than this, I don't think Kani is impacted.

@zhassan-aws

zhassan-aws commented Jul 26, 2024

Copy link
Copy Markdown
Contributor

I think we used to see loop-unwinding information while running Kani, that is now no longer the case.

While I'm happy to see that, users may have depended on this output to see when CBMC is unwinding forever. So, I think we should at least point this change out in the CHANGELOG.md.

I would also suggest adding a Kani option (e.g. --cbmc-stats or --solver-stats?) that would turn on --verbosity 9 in case users want to restore the old behavior. What do you think?

@feliperodrifeliperodri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it! (after @zhassan-aws comments)

Comment threadtests/expected/shadow/unsupported_num_objects/test.rs
Comment threadtests/expected/shadow/slices/slice_of_array/test.rs Outdated
Comment threadkani-compiler/src/codegen_cprover_gotoc/codegen/statement.rs
@tautschnigtautschnig changed the title Update to CBMC version 6.1.0Update to CBMC version 6.1.1Jul 31, 2024
@tautschnig
tautschnig merged commit e4078b4 into model-checking:mainJul 31, 2024
@tautschnig
tautschnig deleted the cbmc-6 branch July 31, 2024 09:55
tautschnig added a commit to tautschnig/kani that referenced this pull request Jul 31, 2024
CBMC v6 included changes to hide timing information and loop unwinding
status output at the default verbosity. To not impact Kani users, model-checking#2995
included changes to make Kani run CBMC with `--verbosity 9`. This change
now makes Kani run CBMC with just the default verbosity, hiding timing
information and loop unwinding status by default. If users still wish to
see this information, they can invoke Kani with
`--cbmc args --verbosity 9`.
github-merge-queueBot pushed a commit that referenced this pull request Aug 9, 2024
## 0.54.0
### Major Changes
* We added support for slices in the `#[kani::modifies(...)]` clauses
when using function contracts.
* We introduce an `#[safety_constraint(...)]` attribute helper for the
`Arbitrary` and `Invariant` macros.
* We enabled support for concrete playback for harness that contains
stubs or function contracts.
* We added support for log2*, log10*, powif*, fma*, and sqrt*
intrisincs.
### Breaking Changes
* The `-Z ptr-to-ref-cast-checks` option has been removed, and pointer
validity checks when casting raw pointers to references are now run by
default.
## What's Changed
* Make Kani reject mutable pointer casts if padding is incompatible and
memory initialization is checked by @artemagvanian in
#3332
* Fix visibility of some Kani intrinsics by @artemagvanian in
#3323
* Function Contracts: Modify Slices by @pi314mm in
#3295
* Support for disabling automatically generated pointer checks to avoid
reinstrumentation by @artemagvanian in
#3344
* Add support for global transformations by @artemagvanian in
#3348
* Enable an `#[safety_constraint(...)]` attribute helper for the
`Arbitrary` and `Invariant` macros by @adpaco-aws in
#3283
* Fix contract handling of promoted constants and constant static by
@celinval in #3305
* Bump CBMC Viewer to 3.9 by @tautschnig in
#3373
* Update to CBMC version 6.1.1 by @tautschnig in
#2995
* Define a struct-level `#[safety_constraint(...)]` attribute by
@adpaco-aws in #3270
* Enable concrete playback for contract and stubs by @celinval in
#3389
* Add code scanner tool by @celinval in
#3120
* Enable contracts in associated functions by @celinval in
#3363
* Enable log2*, log10* intrinsics by @tautschnig in
#3001
* Enable powif* intrinsics by @tautschnig in
#2999
* Enable fma* intrinsics by @tautschnig in
#3002
* Enable sqrt* intrinsics by @tautschnig in
#3000
* Remove assigns clause for ZST pointers by @carolynzech in
#3417
* Instrumentation for delayed UB stemming from uninitialized memory by
@artemagvanian in #3374
* Unify kani library and kani core logic by @jaisnan in
#3333
* Stabilize pointer-to-reference cast validity checks by @artemagvanian
in #3426
* Rust toolchain upgraded to `nightly-2024-08-07` by @jaisnan@qinheping@tautschnig@feliperodri
## New Contributors
* @carolynzech made their first contribution in
#3387
**Full Changelog**:
kani-0.53.0...kani-0.54.0
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
github-merge-queueBot pushed a commit that referenced this pull request Aug 15, 2024
In some cases, Kani would report a spurious counter example for cases
where a match arm contained more than one pattern. This was fixed by
changing how we handle storage lifecycle in #2995. This PR is only
adding the related test to the regression.
Resolves#3432
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
tautschnig added a commit to tautschnig/kani that referenced this pull request Jul 4, 2025
These tests were moved while working towards
model-checking#2995, but do not appear to
be excessively slow even with the final version committed when
completing that PR. (`copy_empty_string_by_intrinsic.rs` completes
within a few seconds, `push_slow.rs` takes one minute and around 4 GB of
memory, but this is still well below what other tests in our regression
test suite take.)
github-merge-queueBot pushed a commit that referenced this pull request Jul 15, 2025
These tests were moved while working towards
#2995, but do not appear to
be excessively slow even with the final version committed when
completing that PR. (`copy_empty_string_by_intrinsic.rs` completes
within a few seconds, `push_slow.rs` takes one minute and around 4 GB of
memory, but this is still well below what other tests in our regression
test suite take.)
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-EndToEndBenchCITag a PR to run benchmark CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spurious failures caused by handling of storage markers Nightly CBMC jobs fail due to goto-cc version mismatch

4 participants

@tautschnig@zhassan-aws@remi-delmas-3000@feliperodri