Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rethink API #31

Open
frewsxcv opened this issue Jan 26, 2016 · 3 comments
Open

Rethink API #31

frewsxcv opened this issue Jan 26, 2016 · 3 comments

Comments

@frewsxcv
Copy link
Member

Would be nice to make this library simpler to use. I've been thinking an API like this:

use afl;

fn main() {
    // Some setup can happen here

    // Loop that AFL will run
    afl::run(|inputted_string| {
        let _ = some_library::parse_string(inputted_string);
    });
}

inputted_string would be a String. the closure inside afl::run is the only thing that gets run upon every subsequent call by AFL using the deferred init strategy

@frewsxcv
Copy link
Member Author

Another idea here. Something like cargo bench:

#[fuzz]
fn test_fuzz(bytes: Vec<u8>) {
    ...
}

which can be invoked with something like cargo afl-fuzz

@alex
Copy link
Member

alex commented Apr 23, 2016

Nice! even simpler, I love it.

On Sat, Apr 23, 2016 at 11:44 AM, Corey Farwell notifications@github.com
wrote:

Another idea here. Something like cargo bench:

#[fuzz]fn test_fuzz(bytes: Vec) {
...
}

which can be invoked with something like cargo afl-fuzz


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#31 (comment)

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6

@frewsxcv
Copy link
Member Author

frewsxcv commented May 2, 2016

Note to future self:

rust-quickcheck implements a #[quickcheck] compiler plugin very similar to what I was thinking above.

example of usage

compiler plugin source

PaulGrandperrin added a commit to rust-fuzz/honggfuzz-rs that referenced this issue Feb 9, 2018
The library code is now a lot simpler, does not use macros
and gives users a lot more control.

This solves cargo-fuzz's issue rust-fuzz/cargo-fuzz#101

This syntax is also very similar to the one in AFL.rs.
Maybe we should converge to a compatible API? rust-fuzz/afl.rs#31
PaulGrandperrin added a commit to PaulGrandperrin/afl.rs that referenced this issue Apr 27, 2018
Performance goes from ~2200/s to 17000/s on my i7-7700HQ
while fuzzing the `url_read` target.

closes rust-fuzz#131
partially addresses rust-fuzz#31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants