Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Codegen storage markers as assignments to __CPROVER_dead_object #3164

Closed

Conversation

tautschnig
Copy link
Member

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: #3099

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

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
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Apr 26, 2024
@tautschnig
Copy link
Member Author

tautschnig commented Apr 26, 2024

This still requires a fix on the CBMC side for contracts instrumentation not to fail, which is in diffblue/cbmc#8261.

@tautschnig
Copy link
Member Author

Closing as the changes are now included in #2995.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Z-BenchCI Tag 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
2 participants