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

Towards Proving Memory Initialization #3264

Merged
merged 99 commits into from
Jul 2, 2024

Conversation

artemagvanian
Copy link
Contributor

@artemagvanian artemagvanian commented Jun 12, 2024

This PR enables automatic memory initialization proofs for raw pointers in Kani. This is done without any extra instrumentation from the user.

Currently, due to high memory consumption and only partial support of pointee types for which memory initialization proofs work, this feature is gated behind -Z uninit-checks flag. Note that because it uses shadow memory under the hood, programs using this feature need to pass -Z ghost-state flag as well.

This PR is a part of working towards #3300.

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

@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Jun 12, 2024
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Can you please double check that invoking methods through the vtable works well? You can for example test drop of Box<dyn Debug> for cases where it is a valid value or it is an uninitialized value.

@artemagvanian artemagvanian marked this pull request as ready for review June 18, 2024 01:37
@artemagvanian artemagvanian requested a review from a team as a code owner June 18, 2024 01:37
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

So close!! Can you please add a few tests for catching intrinsics misuse?

Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Thank you

@artemagvanian artemagvanian merged commit d926482 into model-checking:main Jul 2, 2024
24 of 25 checks passed
artemagvanian added a commit that referenced this pull request Jul 12, 2024
…cks (#3313)

This is a follow-up PR for #3264, a part of the larger work towards
#3300.

This PR introduces:

- Use of demonic non-determinism (prophecy variables) to improve memory
initialization checks performance;
- Instead of keeping track of memory initialization of each possibly
uninitialized byte pointed to by some pointer, one is chosen
non-deterministically;
- Tests for proper memory initialization checks injection for compiler
intrinsics;
- Separate functions for checking memory initialization of slice chunks.

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

---------

Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

3 participants