This is an archive of the discontinued LLVM Phabricator instance.

[YAMLIO] Add a generic YAML fuzzer harness
ClosedPublic

Authored by scott.linder on Nov 16 2020, 3:16 PM.

Details

Summary

This is essentially a clone of the existing fuzzer added in https://reviews.llvm.org/D50839, but for the top-level parser, and only testing for sanitizer violations.

Diff Detail

Event Timeline

scott.linder created this revision.Nov 16 2020, 3:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2020, 3:16 PM
scott.linder requested review of this revision.Nov 16 2020, 3:16 PM
This revision is now accepted and ready to land.Nov 17 2020, 6:59 PM
dexonsmith added inline comments.Nov 17 2020, 7:05 PM
llvm/tools/llvm-yaml-parser-fuzzer/yaml-parser-fuzzer.cpp
16–17

On further thought: should this be iterating through all the documents?

dexonsmith requested changes to this revision.Nov 17 2020, 7:10 PM

(Requesting changes to highlight my question.)

This revision now requires changes to proceed.Nov 17 2020, 7:10 PM
dexonsmith accepted this revision.Nov 18 2020, 1:43 PM

I suggest changing this patch to include the isValidYaml function from https://reviews.llvm.org/D84050 and call that, and then that revision can be rebased on top of this one. If you do that, this LGTM.

This revision is now accepted and ready to land.Nov 18 2020, 1:43 PM
This revision was landed with ongoing or failed builds.Nov 18 2020, 3:06 PM
This revision was automatically updated to reflect the committed changes.

I suggest changing this patch to include the isValidYaml function from https://reviews.llvm.org/D84050 and call that, and then that revision can be rebased on top of this one. If you do that, this LGTM.

This is what I ended up doing, thank you! I also adopted the vector<uint8_t> style here and copied back the matching comment from the next patch. Let me know if you notice any mistakes.