Commit Graph

159 Commits

Author SHA1 Message Date
Kostya Serebryany
7482ffbe49 [libFuzzer] add AFL-style dictionary for C++, remove the old file with tokens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256229 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 01:50:51 +00:00
Kostya Serebryany
62663ee66e [libFuzzer] deprecate -save_minimized_corpus, -merge can be used instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256086 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 03:42:16 +00:00
Kostya Serebryany
cf686ded44 [libFuzzer] split the tests to run them in parallel, remove one redundant test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256085 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 03:35:30 +00:00
Kostya Serebryany
a1e5f35b02 [libFuzzer] make CrossOver just one of the other mutations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 02:49:09 +00:00
Kostya Serebryany
7ed616c150 [libFuzzer] print successfull mutations sequences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 01:09:49 +00:00
Peter Collingbourne
5b00f3232b Fuzzer: Fix library dependencies.
Newer versions of libstdc++ (4.9+), as well as libc++, depend directly on
libpthread from the standard library headers, so libfuzzer needs to declare
a standard library dependency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 02:14:57 +00:00
Mike Aizatsky
6d5ee5a800 [LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.
Differential Revision: http://reviews.llvm.org/D15339

done

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 20:41:53 +00:00
Kostya Serebryany
d33fc70ecf [libFuzzer] don't reload the corpus more than once every second
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 02:09:22 +00:00
Kostya Serebryany
3f8065b694 [libFuzzer] compute base64 in-process instead of using an external lib. Since libFuzzer should not depend on anything, just re-implement base64 encoder. PR25746
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 22:29:39 +00:00
Mike Aizatsky
ba2d199d49 Libfuzzer: do not pass null into user function
Differential Revision: http://reviews.llvm.org/D15098

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254558 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 22:43:53 +00:00
Kostya Serebryany
569415a25b [libFuzzer] add a test that is built with -fsanitize-coverage=trace-bb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 02:49:37 +00:00
Kostya Serebryany
e8d7ae6209 [libFuzzer] add a flag -exact_artifact_path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254100 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-25 21:40:46 +00:00
Kostya Serebryany
45ac8bc6fc [libFuzzer] don't crash when reporting a leak in test_single_input mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 03:46:43 +00:00
Kostya Serebryany
01400f4e22 [libFuzzer] remove default initializer as a workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68399. Don't need it anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253419 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 01:08:30 +00:00
Kostya Serebryany
ad9ec32c1f [libFuzzer] make libFuzzer build even with a compiler that does not have sanitizer headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:54:40 +00:00
Mike Aizatsky
c1a030fd64 output_csv libfuzzer option
Summary:
The option outputs statistics in CSV format preceded by 1 header line.
This is intended for machine processing of the output.
-verbosity=0 should likely be set.

Differential Revision: http://reviews.llvm.org/D14600

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 04:38:40 +00:00
Kostya Serebryany
1a42a60ebc [libFuzzer] experimental flag -drill (another search heuristic; Mike Aizatsky's idea)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252838 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 01:02:01 +00:00
Kostya Serebryany
f357e6fb5f [libFuzzer] add UninstrumentedTest.cpp (missing from a previous commit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 22:02:56 +00:00
Kostya Serebryany
f41e3780b3 [libFuzzer] make libFuzzer link if there is no sanitizer coverage instrumentation (it will fail at start-up time)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252533 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 23:17:45 +00:00
Kostya Serebryany
331a8c8a87 [libFuzzer] print a bit fewer lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:19:42 +00:00
Kostya Serebryany
d022e94463 [libFuzzer] when choosing the next unit to mutate, give some preference to the most recent units (they are more likely to be interesting)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 23:22:25 +00:00
Kostya Serebryany
af639be62f [libFuzzer] make -test_single_input more reliable: make sure the input's size is equal to it's capacity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:57:25 +00:00
Kostya Serebryany
242325ad98 [libFuzzer] add -merge flag to merge corpora
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 01:16:40 +00:00
Kostya Serebryany
b33343ddb1 [libFuzzer] remove some old code; also make __sanitizer_get_total_unique_caller_callee_pairs weak so that newer libFuzzer works with older asan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251133 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 18:37:58 +00:00
Kostya Serebryany
7bcc4cdbdd [libFuzzer] use the indirect caller-callee counter as an independent search heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 23:55:39 +00:00
Kostya Serebryany
41180c6eba [libFuzzer] more refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:56:45 +00:00
Kostya Serebryany
1969ec112d [libFuzzer] refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251074 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:50:47 +00:00
Kostya Serebryany
a3619c6b43 [libFuzzer] remove the deprecated 'tokens' feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:48:09 +00:00
Craig Topper
44bf343ec1 Make a bunch of static arrays const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:15:34 +00:00
Kostya Serebryany
2a50aa48db [libFuzzer] add -shuffle flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-17 04:38:26 +00:00
Kostya Serebryany
9b24e29d72 [libFuzzer] print a stack trace on timeout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:04:31 +00:00
Kostya Serebryany
5792846506 [libFuzzer] reduce the size of artifacts printed on the screen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250565 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 22:47:20 +00:00
Kostya Serebryany
17062e257e [libFuzzer] When -test_single_input crashes the test it is not necessary to write crash-file because input is already known to the user. Patch by Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250564 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 22:41:47 +00:00
Kostya Serebryany
002f1b00d6 [libFuzzer] don't print large artifacts to stderr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 04:03:14 +00:00
Kostya Serebryany
22d6013f13 [libFuzzer] add -artifact_prefix flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 03:57:59 +00:00
Kostya Serebryany
5cacd53f76 [libFuzzer] fix 32-bit build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08 00:59:25 +00:00
Kostya Serebryany
2e700c9bf6 [libFuzzer] trying to fix at-exit hang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 07:02:05 +00:00
Kostya Serebryany
9906eefc84 [libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. The actual return value is not *yet* used (and expected to be 0). This change is API breaking, so the fuzzers will need to be updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 23:34:06 +00:00
Kostya Serebryany
f351bce7bd [libFuzzer] remove experimental flag and functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 22:00:32 +00:00
Kostya Serebryany
cd0d243e72 [libFuzzer] add a flag -max_total_time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 20:47:55 +00:00
Ivan Krasin
55928e792c [LibFuzzer] test_single_input option to run a single test case.
-test_single_input flag specifies a file name with test data.

Review URL: http://reviews.llvm.org/D13359

Patch by Mike Aizatsky!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 23:23:06 +00:00
Kostya Serebryany
22e2376e14 [libFuzzer] Marking exported symbols as visible. Patch by Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30 22:22:37 +00:00
Kostya Serebryany
8a15ef599e [libFuzzer] perform fewer crossover operations compared to plain mutations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 00:20:58 +00:00
Kostya Serebryany
8eaf34eed8 [libFuzzer] refactor the code to allow building libFuzzer on platforms that don't have dfsan and don't support weak functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 18:48:38 +00:00
Kostya Serebryany
a8d8dba0a6 [libFuzzer] add two more variants of FuzzerDriver for convenience
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 16:57:57 +00:00
Ivan Krasin
9e01a11e67 [libFuzzer]Add a test for defeating a hash sum.
Summary:
Add a test for a data followed by 4-byte hash value.
I use a slightly modified Jenkins hash function,
as described in https://en.wikipedia.org/wiki/Jenkins_hash_function

The modification is to ensure that hash(zeros) != 0.

Reviewers: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12648

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 21:22:52 +00:00
Kostya Serebryany
88d071c626 [libFuzzer] remove a piece of stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 20:40:10 +00:00
Kostya Serebryany
e96dc98acb [libFuzzer] be more robust when dealing with files on disk (e.g. don't crash if a file was there but disappeared)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247066 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 20:36:33 +00:00
Kostya Serebryany
828d315fd6 [libFuzzer] better documentatio for -save_minimized_corpus=1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 17:43:51 +00:00
Kostya Serebryany
06465a68cc [libFuzzer] remove -iterations as redundant (there is also -num_runs)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 17:30:35 +00:00