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

Move OSS-Fuzz target file under tests #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mschwager
Copy link
Contributor

Hi again!

I'm back working on fuzzing and trying to learn more about OSS-Fuzz. After my initial research into this project, I'm now hoping to promote it to OSS-Fuzz's "initial integration" tier. This requires: "Fuzz targets need to be checked into their upstream repository and integrated into the build system with sanitizer support."

I think this also helps with project developers who'd like to run the fuzz tests, but not necessarily install all the OSS-Fuzz infrastructure. loads_fuzzer.py can be run locally with the following commands...

First, install the fuzz dependencies:

python -m pip install -e .[fuzz]

Next, run the fuzz tests:

python tests/fuzzers/loads_fuzzer.py

This should produce output like the following:

INFO: Using preloaded libfuzzer
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 2252594525
INFO: Loaded 1 modules   (4545 inline 8-bit counters): 4545 [0xffffb9d38c20, 0xffffb9d39de1), 
INFO: Loaded 1 PC tables (4545 PCs): 4545 [0xffffb9d39de8,0xffffb9d4b9f8), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 123 ft: 124 corp: 1/1b exec/s: 0 rss: 61Mb
	NEW_FUNC[1/1]: 0xffffb9cdb030 in decode_bytestring /app/cbor2/source/decoder.c:686
#5	NEW    cov: 132 ft: 141 corp: 2/2b lim: 4 exec/s: 0 rss: 62Mb L: 1/1 MS: 3 CrossOver-CopyPart-ChangeBit-
	NEW_FUNC[1/1]: 0xffffb9ce0ce8 in string_namespace_add /app/cbor2/source/decoder.c:512
...

Let me know if you'd like loads_fuzzer.py to live in a different location in the repository.

@coveralls
Copy link

Coverage Status

coverage: 93.542%. remained the same
when pulling 3284769 on mschwager:mschwager-fuzz-target
into e1b65f2 on agronholm:master.

@coveralls
Copy link

Coverage Status

coverage: 93.542%. remained the same
when pulling 88e4b90 on mschwager:mschwager-fuzz-target
into e1b65f2 on agronholm:master.

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.

2 participants