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

Add simple fuzzing #168

Merged
merged 2 commits into from Oct 30, 2019
Merged

Add simple fuzzing #168

merged 2 commits into from Oct 30, 2019

Conversation

@dpc
Copy link
Contributor

dpc commented Oct 13, 2019

Add simple fuzzing

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).

@dpc dpc changed the title Add simple fuzzing (WIP) Add simple fuzzing Oct 13, 2019
@dpc
Copy link
Contributor Author

dpc commented Oct 13, 2019

It will probably take me couple of iterations to figure out the details and do some final polishing, but feel free to give feedback.

All right, looks somewhat presentable.

@dpc dpc force-pushed the dpc:fuzz branch from 8ef77df to 7e9a865 Oct 13, 2019
@dpc dpc changed the title (WIP) Add simple fuzzing Add simple fuzzing Oct 13, 2019
@dpc dpc force-pushed the dpc:fuzz branch from 7e9a865 to 1e2c32a Oct 13, 2019
dpc referenced this pull request in MaulingMonkey/crev-proofs Oct 13, 2019
@jdm
Copy link
Member

jdm commented Oct 15, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Oct 19, 2019

The latest upstream changes (presumably #162) made this pull request unmergeable. Please resolve the merge conflicts.

@dpc
Copy link
Contributor Author

dpc commented Oct 20, 2019

I can rebase if someone reviews. :D

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 29, 2019

Running the fuzzer returns an error unless I create an in directory and add some input files first. Should there be initial input files checked in to the repository?

@dpc
Copy link
Contributor Author

dpc commented Oct 29, 2019

@mbrubeck Are you using afl? Yes. Please do something like:

mkdir in
echo "a" > in/foo
@dpc
Copy link
Contributor Author

dpc commented Oct 29, 2019

I'm not sure if I should add this to the README.md or just check it in. Ideally in should contain some failing cases, as far as I understand, though it i not necessary for such a simple fuzzing target.

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 29, 2019

Yes, having a basic one-byte input checked in to the repo would be good; it'll be one less step for people to get started (or for scripts running fuzzing in CI).

Copy link
Contributor

mbrubeck left a comment

This looks great, thanks! Just needs a rebase and an AFL input file, as discussed above.

@dpc dpc force-pushed the dpc:fuzz branch from 2730d4f to a7121ad Oct 29, 2019
@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 29, 2019

The build failure is because #145 changed the API for SmallVec::drain. It takes a range argument now.

@dpc
Copy link
Contributor Author

dpc commented Oct 29, 2019

@mbrubeck Oh. I did a naive rebase, as I don't have access to my normal dev box. I'll fix it later today / tomorrow. Thanks!

@dpc dpc force-pushed the dpc:fuzz branch from a7121ad to ea412c5 Oct 30, 2019
dpc added 2 commits Oct 13, 2019
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 #124
@dpc dpc force-pushed the dpc:fuzz branch from ea412c5 to a3ba738 Oct 30, 2019
@dpc
Copy link
Contributor Author

dpc commented Oct 30, 2019

@mbrubeck Done. :)

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 30, 2019

@bors-servo r+

Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Oct 30, 2019

📌 Commit a3ba738 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Oct 30, 2019

Testing commit a3ba738 with merge 01917a6...

bors-servo added a commit that referenced this pull request Oct 30, 2019
Add simple fuzzing

Add simple fuzzing

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).
@bors-servo
Copy link
Contributor

bors-servo commented Oct 30, 2019

☀️ Test successful - checks-travis
Approved by: mbrubeck
Pushing 01917a6 to master...

@bors-servo bors-servo merged commit a3ba738 into servo:master Oct 30, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Oct 30, 2019
* [breaking change] Use `MaybeUninit` internally to avoid possible undefined behavior (servo#162, servo#170).
* [breaking change] The `drain` method now takes a range argument, just like the standard `Vec::drain` (servo#145).
* [breaking change] Remove the `unreachable` function and replace it with the new standard `unreachable_unchecked` function (servo#164).
* [breaking change] Use `no_std` by default. This crate depends only on `core` and `alloc` by default. If the optional `write` feature is enabled then it depends on `std` so that `SmallVec<[u8, _]>` can implement the `std::io::Write` trait (servo#173).
* Add support for 96-element small vectors, `SmallVec<[T; 96]>` (servo#163).
* Iterators now implement `FusedIterator` (servo#172).
* Indexing now uses the standard `SliceIndex` trait (servo#166).
* Remove the deprecated `VecLike` trait (servo#165).
* Use `NonNull` internally (servo#171).
* Add automatic fuzz testing and MIRI testing (servo#168, servo#162).
* Update syntax and formatting to Rust 2018 standard (servo#174, servo#167).
@mbrubeck mbrubeck mentioned this pull request Oct 30, 2019
bors-servo added a commit that referenced this pull request Nov 2, 2019
Version 1.0.0

* Requires Rust 1.36 or later.
* [breaking change] Use `MaybeUninit` to avoid possible undefined behavior (#162, #170).
* [breaking change] The `drain` method now takes a range argument, just like the standard `Vec::drain` (#145).
* [breaking change] Remove the `unreachable` function and replace it with the new standard `unreachable_unchecked` function (#164).
* [breaking change] Use `no_std` by default. This crate depends only on `core` and `alloc` by default. If the optional `write` feature is enabled then it depends on `std` so that `SmallVec<[u8;_]>` can implement the `std::io::Write` trait (#173).
* Add support for 96-element small vectors, `SmallVec<[T; 96]>` (#163).
* Iterators now implement `FusedIterator` (#172).
* Indexing now uses the standard `SliceIndex` trait (#166).
* Remove the deprecated `VecLike` trait (#165).
* Use `NonNull` internally (#171).
* Add automatic fuzz testing and MIRI testing (#168, #162).
* Update syntax and formatting to Rust 2018 standard (#174, #167).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.