Skip to content

OSS-Fuzz: Add corpus/dict for existing fuzzers - #1212

Open
arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-corpus-dict-options
Open

arthurscchan wants to merge 1 commit into
msgpack:cpp_masterfrom
arthurscchan:msgpack-c-corpus-dict-options

Conversation

@arthurscchan

Copy link
Copy Markdown

This PR adds corpus/dict for existing fuzzers, together with google/oss-fuzz#16492 to improve the overall fuzzing coverage and effectiveness for project msgpack-c.

@redboltz

Copy link
Copy Markdown
Contributor

Appveyor reported errors.
I've fixed appveyor environment. Could you rebase your PRs ?

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan
arthurscchan force-pushed the msgpack-c-corpus-dict-options branch from 0a6d749 to 994ee03 Compare November 20, 2026 07:35
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.96%. Comparing base (39cc081) to head (994ee03).
⚠️ Report is 44 commits behind head on cpp_master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff               @@
##           cpp_master    #1212      +/-   ##
==============================================
- Coverage       85.36%   79.96%   -5.41%     
==============================================
  Files              80       80              
  Lines            5099     5824     +725     
  Branches          507      638     +131     
==============================================
+ Hits             4353     4657     +304     
- Misses            746     1167     +421     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arthurscchan

Copy link
Copy Markdown
Author

@redboltz Thanks for the review. I have rebased the PR, together with the other PRs that I created.

@redboltz

Copy link
Copy Markdown
Contributor

Thank you for the series (#1212, #1213, #1214, #1215). I reviewed the four PRs together. The direction is good and I'd like to merge them, but there is one problem shared by all four that needs fixing first. I'll put the shared items here and comment on the PR-specific points in each PR.

Shared by all four PRs: the .dict files use the wrong format

All four dictionaries (unpack_pack_fuzzer.dict, object_convert_fuzzer.dict, stream_unpack_fuzzer.dict, vrefbuffer_pack_fuzzer.dict) are written like this:

"nil=\xc0"
"fixstr_max=\xbf"

In the libFuzzer / AFL dictionary format the name goes outside the quotes. A line that starts with " is a nameless entry and the whole quoted string is the token, so right now every entry inserts the ASCII text nil= followed by 0xc0 as one token. I confirmed this on a local libFuzzer build: with -dict enabled the inputs quickly fill up with ASCII such as fixstr_max=, and the fuzzer log shows the tokens as DE: "int8=\320"-"bin8=\304"-. All 45 entries are prefixed with text that is meaningless as MessagePack, so the dictionaries are effectively useless as written.

Each line should be:

nil="\xc0"
false="\xc2"
true="\xc3"
...
timestamp96="\xc7\x0c\xff"
never_used="\xc1"

The four files are identical, so the same fix applies to all of them.

Other shared notes (non-blocking)

Specific to this PR

  • The 24 committed seed files match the output of gen_unpack_pack_seeds.py exactly, and they all pass with the existing unpack_pack_fuzzer (-runs=0). Good.
  • GenInt64Edges ends with b'\xd3\xff'*8. I assume the intent was b'\xd3' + b'\xff'*8 (int64 -1); as written it is a sequence of truncated int64 headers. It still works as an error-path seed, so this is only a nit, but please fix it if you touch the script anyway.

Request

When you update the PR, please rebase it onto the current cpp_master rather than merging. cpp_master has moved since this series was opened (several unpacker / zone / vrefbuffer fixes, and #1231 which fixes a bug that #1213's harness found).

@arthurscchan

Copy link
Copy Markdown
Author

OK. I will handle them, please give me over the weekend, thanks.

This branch has not been deployed

No deployments
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.

3 participants