test: add parser and serializer fuzzing - #178
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds libFuzzer-based fuzzing for libfastjson’s parser and serializer, including deterministic seed-corpus replay during make check and a scheduled GitHub Actions job to run short ASan/UBSan fuzz campaigns.
Changes:
- Introduce parser and serializer fuzz targets plus deterministic corpus replay test executables.
- Check in seed corpora and a fuzzing maintenance README/dictionary.
- Add a daily scheduled GitHub Actions workflow to run
make fuzz-smoke, with caching to skip already-fuzzed commits.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_fuzz_serializer.test |
Adds make check driver to replay serializer seed corpus. |
tests/test_fuzz_serializer.c |
Adds serializer fuzz target + replay main() under FUZZ_REPLAY. |
tests/test_fuzz_parser.test |
Adds make check driver to replay parser seed corpus. |
tests/test_fuzz_parser.c |
Adds parser fuzz target + replay main() under FUZZ_REPLAY. |
tests/Makefile.am |
Wires new fuzz replay tests into TESTS and ships fuzz assets via EXTRA_DIST. |
tests/fuzz/README.md |
Documents how to build/run fuzzers and maintain the corpus. |
tests/fuzz/json.dict |
Adds a small JSON dictionary for fuzzing. |
tests/fuzz/corpus/serializer/strings.seed |
Adds serializer seed input. |
tests/fuzz/corpus/serializer/nesting.seed |
Adds serializer seed input. |
tests/fuzz/corpus/parser/truncated.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/object.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/number.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/invalid.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/escaped.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/deep.json |
Adds parser seed input. |
tests/fuzz/corpus/parser/array.json |
Adds parser seed input. |
Makefile.am |
Adds make fuzz and make fuzz-smoke targets for libFuzzer + sanitizers. |
.github/workflows/daily_fuzz.yml |
Adds scheduled workflow to run fuzz-smoke daily with caching/skip logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rgerhards
force-pushed
the
codex/add-fuzz-regression-tests
branch
2 times, most recently
from
July 23, 2026 16:01
4392250 to
57ecbd7
Compare
rgerhards
force-pushed
the
codex/add-fuzz-regression-tests
branch
from
July 23, 2026 16:27
57ecbd7 to
65edfb2
Compare
rgerhards
marked this pull request as ready for review
July 24, 2026 07:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make checkValidation
actionlint .github/workflows/daily_fuzz.ymlyamllint .github/workflows/daily_fuzz.ymlmake check(20/20)Summary by cubic
Add libFuzzer fuzzing for the JSON parser and serializer with deterministic corpus replay in
make check. Adds PR smoke runs and a daily ASan/UBSan fuzzing job with caching and failure reporting.New Features
fuzzandfuzz-smoke(supportsFUZZ_SECONDS,FUZZ_RSS_LIMIT_MB,FUZZ_CC).test_fuzz_parserandtest_fuzz_serializerin the test suite.tests/fuzz/json.dict, andtests/fuzz/README.mdwith usage notes.fuzz-smoke(30s); daily 5-minute run skips already-fuzzed commits via cache, enforces concurrency/timeouts, usesactions/checkout,actions/cache,actions/github-script, and creates/updates a “Daily fuzzing failures” issue with commit and run link on failure.Dependencies
FUZZ_CXX_LIBSif needed. The workflow installsautoconf,automake,clang,g++, andlibtool.Written for commit 65edfb2. Summary will update on new commits.