-
Notifications
You must be signed in to change notification settings - Fork 150
Should we try to be more formal about safety? #124
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
Comments
I was just filling a You could follow examples from eg. |
https://github.com/jakubadamw/arbitrary-model-tests should make fuzzing a breeze, since you already have std::vec as a model to check against. |
Related to servo#124
Add infrastructure to automatically run fuzzers in CI, and implement a simple fuzzing test based on triggering all (most) public APIs in a randimized way. As far as I was able to try it catches the previous unsoundness issues in a matter of seconds. This can be tried by changing the `path = "../"` dependency to `version = "=0.6.3"` etc. and running the fuzzer manually. (Note: You'll need to tweak the `Cargo.lock` to allow downloading the yanked versions). Related to servo#124
Add infrastructure to automatically run fuzzers in CI, and implement a simple fuzzing test based on triggering all (most) public APIs in a randimized way. As far as I was able to try it catches the previous unsoundness issues in a matter of seconds. This can be tried by changing the `path = "../"` dependency to `version = "=0.6.3"` etc. and running the fuzzer manually. (Note: You'll need to tweak the `Cargo.lock` to allow downloading the yanked versions). Related to servo#124
Add infrastructure to automatically run fuzzers in CI, and implement a simple fuzzing test based on triggering all (most) public APIs in a randimized way. As far as I was able to try it catches the previous unsoundness issues in a matter of seconds. This can be tried by changing the `path = "../"` dependency to `version = "=0.6.3"` etc. and running the fuzzer manually. (Note: You'll need to tweak the `Cargo.lock` to allow downloading the yanked versions). Related to servo#124
Add infrastructure to automatically run fuzzers in CI, and implement a simple fuzzing test based on triggering all (most) public APIs in a randimized way. As far as I was able to try it catches the previous unsoundness issues in a matter of seconds. This can be tried by changing the `path = "../"` dependency to `version = "=0.6.3"` etc. and running the fuzzer manually. (Note: You'll need to tweak the `Cargo.lock` to allow downloading the yanked versions). Related to servo#124
I've developed a library for my bachelor's thesis which has the goal to aid developers in being more formal about safety. It works by annotating unsafe functions with the preconditions that need to be upheld for their safety. This has two main advantages:
Such annotations could be added behind a If you'd be interested in such annotations, I would be happy to prepare a pull request adding some of them to smallvec. If so, which part of the code would benefit most from such annotations? If you're not interested, I'd appreciate it, if you could briefly let me know why, as that would be valuable feedback for my thesis. |
Meanwhile arbitrary-model-tests was renamed to rutenspitz and since yesterday correctly handles panics. It should make fuzzing very easy, and also easily allow verifying that behavior of SmallVec is identical to that of Vec. |
e.g. I could envision a
fn upholds_invariants() -> bool
method that could bedebug_assert!
ed on all methods that useunsafe
, thereby allowing us to fuzz-check for mistakes we may have made w.r.t. memory safety. Alas, there are some invariants we cannot check for now (namely around uninitialized memory), but we could at least document them.We could also add more comments describing why what we do really should be safe, so others can understand – and try to poke holes into – our thinking.
The text was updated successfully, but these errors were encountered: