[PATCH] D42414: [llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus
Justin Bogner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 2 10:01:13 PST 2018
bogner accepted this revision.
bogner added a comment.
This revision is now accepted and ready to land.
I think this is okay to go in, with the caveat that we need a plan for fixing up the verifier and removing this.
================
Comment at: tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp:68-73
if (verifyModule(*M, &errs())) {
errs() << "mutation result doesn't pass verification\n";
M->dump();
- abort();
+ // Avoid adding incorrect test cases to the corpus.
+ return 0;
+ }
----------------
igor-laevsky wrote:
> bogner wrote:
> > Can we drop this part and only verify after the reload?
> I'm not sure how bitcode writer will behave on the invalid module. I would suspect that this verification is fast compared to the save/reload part.
Are you set up to measure this? It'd be nice to qualify that claim.
================
Comment at: tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp:83-85
+ // There are some invariants which are not checked by the verifier in favor
+ // of having them checked by the parser. They may be considered as bugs in the
+ // verifier and should be fixed there. However until all of those are covered
----------------
Interestingly, it would be trivial to write a fuzzer that finds these verifier bugs at this point. Maybe we should do that as a way to move towards a state where we can remove the redundant checks?
https://reviews.llvm.org/D42414
More information about the llvm-commits
mailing list