Skip to content

Challenge proposal: NonNull - #52

Merged
tautschnig merged 5 commits into
model-checking:mainfrom
tautschnig:nonnull-challenge
Aug 26, 2024
Merged

tautschnig merged 5 commits into
model-checking:mainfrom
tautschnig:nonnull-challenge

Conversation

@tautschnig

Copy link
Copy Markdown
Member

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

@tautschnig
tautschnig requested a review from a team as a code owner August 16, 2024 12:23

@zhassan-aws zhassan-aws left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @tautschnig. It seems to me that memory safety for the most of the listed functions would directly follow from their pre-conditions. Thus, I suggest we add the verification of at least one of the modules that use NonNull to this challenge, so that we can verify that the pre-conditions are not too overconstraining. One such module is Unique.

What do you think?

@tautschnig

Copy link
Copy Markdown
Member Author

Thanks @tautschnig. It seems to me that memory safety for the most of the listed functions would directly follow from their pre-conditions. Thus, I suggest we add the verification of at least one of the modules that use NonNull to this challenge, so that we can verify that the pre-conditions are not too overconstraining. One such module is Unique.

What do you think?

I get your concern - but then contracts (and harnesses) for Unique are already PR'ed in #45 in flight, so that's perhaps already sorted?

Comment thread doc/src/challenges/0006-nonnull.md Resolved
@tautschnig
tautschnig merged commit 962b36b into model-checking:main Aug 26, 2024
@tautschnig
tautschnig deleted the nonnull-challenge branch August 26, 2024 08:31
szlee118 pushed a commit to stogaru/verify-rust-std that referenced this pull request Oct 17, 2024
zhassan-aws added a commit that referenced this pull request Nov 15, 2024
…`NonNull::read_unaligned` (#156)

Towards #52 

Contracts & Harnesses for `NonNull::read`, `NonNull::read_volatile`,
`NonNull::read_unaligned`
### Discussion
For the ensures clause in the contract for `NonNull::read`, I could not
directly compare the value pointed by self and result due to unsized and
lack of PartialEq implementation, and the comparison is currently moved
to the harness.
### Verification
Successful verification:
```
SUMMARY:
 ** 0 of 141 failed

VERIFICATION:- SUCCESSFUL
Verification Time: 0.1760525s

Complete - 5 successfully verified harnesses, 0 failures, 5 total.
```

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants