-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
7 changed files
with
521 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
target | ||
Cargo.lock | ||
./Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "smallvec-fuzz" | ||
version = "0.1.0" | ||
authors = ["Dawid Ciężarkiewicz <dpc@dpc.pw>"] | ||
edition = "2018" | ||
publish = false | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[features] | ||
afl_fuzz = ["afl"] | ||
honggfuzz_fuzz = ["honggfuzz"] | ||
|
||
|
||
[dependencies] | ||
honggfuzz = { version = "0.5.45", optional = true } | ||
afl = { version = "0.4", optional = true } | ||
smallvec = { path = ".." } | ||
|
||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "smallvec_ops" | ||
path = "fuzz_targets/smallvec_ops.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Fuzzer for smallvec | ||
|
||
Based on fuzzing in [rust-bitcoin](https://github.com/rust-bitcoin/rust-bitcoin/tree/c8ac25219a09bf9d017f1b05abe3e746e2136f73/fuzz) | ||
|
||
## Running manually with afl | ||
|
||
``` | ||
cargo afl build --release --bin smallvec_ops --features afl && cargo afl fuzz -i in -o out target/release/smallvec_ops | ||
``` | ||
|
||
# Useful links: | ||
* https://rust-fuzz.github.io/book/afl.html |
Oops, something went wrong.