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

Adds a roundtrip fuzz testing suite #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silvergasp
Copy link

This PR adds two fuzz testing harnesses to ensure roundtrip e.g. encode->decode reproduces the same input always. Decode only, this will take an arbitrary input and try and decode to ensure that the decoder can handle invalid inputs successfully.

How to test this out locally;

cd test
# Set clang as compiler (required)
export CC=clang
# Add sanitisation flags (required)
export CFLAGS=-fsanitize=fuzzer-no-link,address
# Build fuzzers
 AVX2_CFLAGS=-mavx2 SSSE3_CFLAGS=-mssse3 SSE41_CFLAGS=-msse4.1 SSE42_CFLAGS=-msse4.2 AVX_CFLAGS=-mavx make fuzz_roundtrip fuzz_decode fuzz_roundtrip
# Run a fuzzer
fuzz_roundtrip

You should expect the fuzzer to run forever or until;

  • It finds a bug and crashes
  • You manually kill it e.g. CTRL-C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant