Skip to content

Conversation

@nathaniel-brough
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.

1 participant