Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
420 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp

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
15–16

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.