Pass seed corpus list in a file to get around argument length limits on Windows.
This limit was preventing many uses of fork mode on Windows.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
- undo accidental
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | ||
---|---|---|
771 ↗ | (On Diff #196154) | Removing the file is somewhat hostile to users but is the best way to prevent the accumulation of files in fork mode. |
compiler-rt/test/fuzzer/cross_over.test | ||
18 ↗ | (On Diff #196154) | The reason why I do this hacky python thing is because echo leaves a trailing newline and printf didn't work well with the percent formatting. |
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | ||
---|---|---|
771 ↗ | (On Diff #196154) | A bit too hostile indeed, and in this case the file is deleted by a process that didn't create it, making it more confusing. |
compiler-rt/lib/fuzzer/FuzzerFlags.def | ||
23 ↗ | (On Diff #196165) | I found this flag to be useful by itself, outside the fork mode, so instead of replacing it with a new flag,
|
compiler-rt/lib/fuzzer/FuzzerFork.cpp | ||
126 ↗ | (On Diff #196165) | for readability, I'd prefer to introduce another variant of WriteToFile: void WriteToFile(const std::string &Str, const std::string &Path); |
compiler-rt/test/fuzzer/cross_over.test | ||
18 ↗ | (On Diff #196154) | no need to change this test with the change I proposed. |
compiler-rt/test/fuzzer/seed_inputs_file.test | ||
4 ↗ | (On Diff #196165) | will echo -n work in this case? |
compiler-rt/lib/fuzzer/FuzzerFlags.def | ||
---|---|---|
23 ↗ | (On Diff #196165) | So that "@" will be necessary to distinguish between a case where we want to use one seed and a case where we want to use the file as the seed list? |
compiler-rt/lib/fuzzer/FuzzerFlags.def | ||
---|---|---|
23 ↗ | (On Diff #196165) | Yes. |
- change name of test
- Get list argument working again
- combine code
- rename
- Use old method
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | ||
---|---|---|
771 ↗ | (On Diff #196154) | Done. |
compiler-rt/lib/fuzzer/FuzzerFlags.def | ||
23 ↗ | (On Diff #196165) | Done. Please let me know if you think the help message needs work. |
compiler-rt/lib/fuzzer/FuzzerFork.cpp | ||
126 ↗ | (On Diff #196165) | Done. |
compiler-rt/test/fuzzer/cross_over.test | ||
18 ↗ | (On Diff #196154) | Undid this change and the one in len_control. |
compiler-rt/test/fuzzer/seed_inputs_file.test | ||
4 ↗ | (On Diff #196165) | Yeah good suggestion, that's much better. For some reason I thought it wouldn't work on Windows. |
LGTM with several nits.
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | ||
---|---|---|
771 ↗ | (On Diff #197346) | plz make this if-else more compact (no {}, comments on the same line) |
compiler-rt/lib/fuzzer/FuzzerFlags.def | ||
24 ↗ | (On Diff #197346) | "of input files" repeated twice? |
compiler-rt/test/fuzzer/seed_inputs.test | ||
3 ↗ | (On Diff #197346) | replace with CHECK: then remove all --check-prefix |
13 ↗ | (On Diff #197346) | terminate the file with a newline |
compiler-rt/test/fuzzer/seed_inputs.test | ||
---|---|---|
3 ↗ | (On Diff #197346) | I added a test to ensure we handle a single file correctly instead. |
@kcc I've changed things so that libFuzzer will fail if the argument to -seed_inputs is a non existent file or is empty? What do you think of this change?
LGTM
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | ||
---|---|---|
776 ↗ | (On Diff #197399) | use exit(1) instead |