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 support for afl-fuzz testing #207

Merged
merged 1 commit into from
Feb 14, 2016
Merged

Conversation

mykter
Copy link

@mykter mykter commented Feb 12, 2016

I tested this library under afl last night: total of 400M executions, ~400 code paths found, no crashes or hangs. Stopped when it was >30mins that any of the fuzzers had found a new path. This is the code I used to support the fuzzing, in case you'd like to easily re-run against any future changes.
(I didn't test under ASAN, as cross compiling with -m32 didn't work out of the box)

"make fuzz" creates a simple executable that de-serialises stdin
and re-serialises to stdout.
"make fuzz_testcases" extracts the smaller json test cases into
a testcases directory.

The library can then be fuzzed as follows:
CC=afl-clang-fast make fuzz
make fuzz_testcases
mkdir out
afl-fuzz -i testcases -o out ./fuzz

"make fuzz" creates a simple executable that de-serialises stdin
and re-serialises to stdout.
"make fuzz_testcases" extracts the smaller json test cases into
a testcases directory.

The library can then be fuzzed as follows:
    CC=afl-clang-fast make fuzz
    make fuzz_testcases
    mkdir out
    afl-fuzz -i testcases -o out ./fuzz
@nlohmann nlohmann added this to the Release 2.0.0 milestone Feb 12, 2016
@nlohmann nlohmann self-assigned this Feb 12, 2016
nlohmann added a commit that referenced this pull request Feb 14, 2016
add support for afl-fuzz testing
@nlohmann nlohmann merged commit ec098ff into nlohmann:master Feb 14, 2016
@nlohmann
Copy link
Owner

Thanks a lot!

nlohmann added a commit that referenced this pull request Feb 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants