Handling differently the iterations with type limit and eventually error message.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/fuzzer/afl/afl_driver.cpp | ||
---|---|---|
309 ↗ | (On Diff #150310) | Maybe next_char would be a more descriptive name here. |
314 ↗ | (On Diff #150310) | Would it make more sense to just exit if iterations is invalid? |
315 ↗ | (On Diff #150310) | Since the if-block returns, else is unnecessary here. |
316 ↗ | (On Diff #150310) | Please use static_cast here. |
lib/fuzzer/afl/afl_driver.cpp | ||
---|---|---|
316 ↗ | (On Diff #150310) | I usually prefer indeed but was not sure if you prefered C's cast style. Ok will address all points. |
test/fuzzer/afl-driver.test | ||
---|---|---|
31 ↗ | (On Diff #150414) | if you use "not" in the test command line you can have a test like that is expected to break |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | Why have you changed these two lines? |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | Most likely because of the exit call. Without this, the previous test passes. |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | If I understand the code correctly, this should cause N to default to 1000. So I don't think exit should be called. |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | If I change the signature of set_iterations to return a value and bring back the else if (argc == 2 && ...) as it was the test passes somehow. |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | Ah, I see. The driver doesn't support specifying N with the deprecated call style. Let's move the deprecation warning to before the call to set_iterations, and change the above test to check for the deprecation warning + the iterations invalid warning. |
test/fuzzer/afl-driver.test | ||
---|---|---|
25 ↗ | (On Diff #150422) | I changed it as asked and realised it indeed exited, i.e the second warning (i.e iterations invalid) displays the path of the file as argument making the conversion to number failing for sure. |
Reposting my comments here from https://reviews.llvm.org/D49141
I think this patch should be reverted.
It breaks afl_driver's command line interface by causing invocations such as ./fuzzer inputfile to fail.
I don't think this breakage was intentional since ./fuzzer inputfile1 inputfile2 still works and I don't think there is a reason to break this.
I've created a revert here: https://reviews.llvm.org/D49141
lib/fuzzer/afl/afl_driver.cpp | ||
---|---|---|
335 ↗ | (On Diff #150422) | I don't think (N = atoi(argv[1])) > 0) should have been removed. |
test/fuzzer/afl-driver.test | ||
25 ↗ | (On Diff #150422) | I think changing this test was incorrect. The test verified that the command line interface worked a certain way. |