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

Provide an interface for fuzzing sequence producer plugins #3551

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

embg
Copy link
Contributor

@embg embg commented Mar 14, 2023

Fuzz-testing for the external sequence producer API was introduced in PR #3437. However, the setup in #3437 only allows fuzzers to exercise the implementation of the API on the libzstd side (the code in the core zstd library which interacts with a plugin). This PR allows us to fuzz the plugin code itself, which is a requirement for us to use plugins (such as hardware accelerators) in production.

Here is an example showing how this new interface allows us to link plugin code into the fuzzer build:

$ make corpora
$ make -C seq_prod_fuzz_example/
$ python3 ./fuzz.py build all --custom-seq-prod=seq_prod_fuzz_example/example_seq_prod.o --enable-fuzzer --enable-asan --enable-ubsan --cc clang --cxx clang++
$ python3 ./fuzz.py libfuzzer simple_round_trip
$ python3 ./fuzz.py libfuzzer stream_round_trip
$ python3 ./fuzz.py libfuzzer dictionary_round_trip
$ # etc...

Copy link
Contributor

@terrelln terrelln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can you also add the documentation about how to build & run the fuzzer in seq_prod_fuzz_example/README.md?

tests/fuzz/fuzz_third_party_seq_prod.h Show resolved Hide resolved
tests/fuzz/fuzz_third_party_seq_prod.h Outdated Show resolved Hide resolved
@GarenJian-Intel
Copy link

Hi @embg, now only simple_round_trip is enabled, will other fuzzers be enabled in this PR or other new PRs? If other fuzzers are ready, could you @ me so that I can try them ASAP?

@embg
Copy link
Contributor Author

embg commented Mar 28, 2023

@GarenJian-Intel Added support for the following fuzzers:

block_round_trip
decompress_dstSize_tooSmall
dictionary_decompress
dictionary_loader
dictionary_round_trip
dictionary_stream_round_trip
raw_dictionary_round_trip
sequence_compression_api
simple_compress
simple_round_trip
stream_round_trip

Also, responded to all nits from @terrelln. Merging after CI passes.

@embg embg merged commit 57e1b45 into facebook:dev Mar 28, 2023
@embg embg deleted the seq_prod_fuzz branch March 28, 2023 21:20
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.

5 participants