summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerDriver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [LibFuzzer] Reimplement how the optional user functions are called.Dan Liew2016-06-021-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this change is to fix linking issues on OSX. However this only partially fixes linking issues (the uninstrumented tests and a few others won't succesfully link yet). This change introduces a struct of function pointers (``fuzzer::ExternalFuntions``) which when initialised will point to the optional functions if they are available. Currently these ``LLVMFuzzerInitialize`` and ``LLVMFuzzerCustomMutator`` functions. Two implementations of ``fuzzer::ExternalFunctions`` constructor are provided one for Linux and one for OSX. The OSX implementation uses ``dlsym()`` because the prior implementation using weak symbols does not work unless the additional flags are passed to the linker. The Linux implementation continues to use weak symbols because the ``dlsym()`` approach does not work unless additional flags are passed to the linker. Differential Revision: http://reviews.llvm.org/D20741 llvm-svn: 271491
* [libFuzzer] when an invalid flag is given, warn, but don't crashKostya Serebryany2016-06-011-2/+3
| | | | llvm-svn: 271404
* [libfuzzer] Trying random unit prefixes during corpus load.Mike Aizatsky2016-05-241-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20301 llvm-svn: 270632
* [libFuzzer] print the file name before executing the input so that if there ↵Kostya Serebryany2016-05-131-1/+2
| | | | | | is a crash we know which files has caused it llvm-svn: 269450
* [libFuzzer] enhance -rss_limit_mb and enable by default. Now it will print ↵Kostya Serebryany2016-05-061-3/+4
| | | | | | the OOM reproducer. llvm-svn: 268821
* [libFuzzer] add exeprimental -rss_limit_mb flag to fight against OOMsKostya Serebryany2016-05-061-0/+17
| | | | llvm-svn: 268807
* [libFuzzer] print stats after running individual inputsKostya Serebryany2016-05-041-1/+2
| | | | llvm-svn: 268547
* [libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, ↵Kostya Serebryany2016-04-201-0/+1
| | | | | | it will help finding leaks while fuzzing llvm-svn: 266838
* [libFuzzer] warn if the corpus is emptyKostya Serebryany2016-04-181-1/+4
| | | | llvm-svn: 266670
* [NFC] Header cleanupMehdi Amini2016-04-181-7/+5
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* [libFuzzer] add a better warning for command line flags with -- (two dashes)Kostya Serebryany2016-04-151-0/+3
| | | | llvm-svn: 266480
* Remove redundant .c_str(), as suggested by PR25633Hans Wennborg2016-04-111-1/+1
| | | | llvm-svn: 265988
* [libFuzzer] handle SIGTERMKostya Serebryany2016-03-241-0/+1
| | | | llvm-svn: 264338
* [libFuzzer] add a flag close_fd_mask so that we can silence spammy targets ↵Kostya Serebryany2016-03-181-0/+5
| | | | | | by closing stderr/stdout llvm-svn: 263831
* [libFuzzer] improve -merge functionalityKostya Serebryany2016-03-181-2/+1
| | | | llvm-svn: 263769
* [libFuzzer] deprecate several flagsKostya Serebryany2016-03-171-10/+4
| | | | llvm-svn: 263739
* [libFuzzer] use max_len exactly equal to the max size of input. Fix 32-bit buildKostya Serebryany2016-03-151-1/+2
| | | | llvm-svn: 263518
* [libFuzzer] try to use max_len based on the items of the corpus instead of ↵Kostya Serebryany2016-03-121-4/+13
| | | | | | blindly defaulting to 64 bytes. llvm-svn: 263323
* [libFuzzer] log less when re-loading files; fix a silly bug: when running ↵Kostya Serebryany2016-03-041-1/+1
| | | | | | single files actually run all of them, not just the first one llvm-svn: 262754
* [libFuzzer] deprecate exit_on_first flagKostya Serebryany2016-03-011-6/+8
| | | | llvm-svn: 262417
* [libFuzzer] add generic signal handlers so that libFuzzer can report at ↵Kostya Serebryany2016-03-011-1/+6
| | | | | | least something if ASan is not handlig the signals for us. Remove abort_on_timeout flag. llvm-svn: 262415
* [libFuzzer] add -print_final_stats=1 flagKostya Serebryany2016-02-261-0/+2
| | | | llvm-svn: 262084
* [libFuzzer] only read MaxLen bytes from every file in the corpus to speedup ↵Kostya Serebryany2016-02-181-1/+1
| | | | | | loading the corpus llvm-svn: 261267
* [libFuzzer] remove std::vector operations from hot paths, NFCKostya Serebryany2016-02-131-1/+1
| | | | llvm-svn: 260829
* [libFuzzer] remove the C++-ish variant of FuzzerDriver from the interfaceKostya Serebryany2016-02-131-6/+7
| | | | llvm-svn: 260801
* [libFuzzer] get rid of UserSuppliedFuzzer; NFCKostya Serebryany2016-02-131-3/+3
| | | | llvm-svn: 260798
* [libFuzzer] simplify the code around Random. NFCKostya Serebryany2016-02-131-11/+10
| | | | llvm-svn: 260797
* [libFuzzer] remove UserSuppliedFuzzer from the interface (it was a bad idea).Kostya Serebryany2016-02-131-13/+3
| | | | llvm-svn: 260796
* [libFuzzer] make -runs=N flag also affect the simple runner (will execute ↵Kostya Serebryany2016-02-121-2/+5
| | | | | | every input N times) llvm-svn: 260649
* [libFuzzer] allow passing 1 or more files as individual inputsKostya Serebryany2016-02-021-2/+28
| | | | llvm-svn: 259459
* [libFuzzer] add -timeout_exitcode optionKostya Serebryany2016-01-291-0/+1
| | | | llvm-svn: 259265
* [libFuzzer] add -abort_on_timeout optionKostya Serebryany2016-01-231-0/+1
| | | | llvm-svn: 258631
* [libFuzzer] use std::mt19937 for generating random numbers by default. Fix ↵Kostya Serebryany2016-01-191-4/+10
| | | | | | MyStoll to handle negative values. Use std::any_of instead of std::find_if llvm-svn: 258178
* [libFuzzer] replace vector with a simpler data structure in the Dictionaries ↵Kostya Serebryany2016-01-161-1/+2
| | | | | | to avoid memory allocations on hot path llvm-svn: 257985
* [libFuzzer] do mutations based on memcmp/strcmp interceptors under a ↵Kostya Serebryany2016-01-151-0/+1
| | | | | | separate flag (-use_memcmp, default=1) llvm-svn: 257873
* [libFuzzer] use custom stol; also introduce __libfuzzer_is_present so that ↵Kostya Serebryany2016-01-151-1/+17
| | | | | | users can check for its presence. llvm-svn: 257848
* [libFuzzer] change the way trace-based mutations are applied. Instead of a ↵Kostya Serebryany2016-01-091-2/+0
| | | | | | custom code just rely on the automatically created dictionary llvm-svn: 257248
* [libFuzzer] add a position hint to the dictionary-based mutatorKostya Serebryany2016-01-071-1/+1
| | | | llvm-svn: 257013
* [libfuzzer] print_new_cov_pcs experimental option.Mike Aizatsky2016-01-061-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D15901 llvm-svn: 256882
* [libFuzzer] deprecate -save_minimized_corpus, -merge can be used insteadKostya Serebryany2015-12-191-3/+6
| | | | llvm-svn: 256086
* [LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.Mike Aizatsky2015-12-101-2/+18
| | | | | | | | Differential Revision: http://reviews.llvm.org/D15339 done llvm-svn: 255296
* [libFuzzer] add a flag -exact_artifact_pathKostya Serebryany2015-11-251-0/+2
| | | | llvm-svn: 254100
* [libFuzzer] don't crash when reporting a leak in test_single_input modeKostya Serebryany2015-11-211-2/+4
| | | | llvm-svn: 253761
* output_csv libfuzzer optionMike Aizatsky2015-11-121-0/+1
| | | | | | | | | | | 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 llvm-svn: 252856
* [libFuzzer] experimental flag -drill (another search heuristic; Mike ↵Kostya Serebryany2015-11-121-5/+13
| | | | | | Aizatsky's idea) llvm-svn: 252838
* [libFuzzer] make -test_single_input more reliable: make sure the input's ↵Kostya Serebryany2015-11-031-1/+3
| | | | | | size is equal to it's capacity llvm-svn: 251961
* [libFuzzer] add -merge flag to merge corporaKostya Serebryany2015-10-241-0/+5
| | | | llvm-svn: 251168
* [libFuzzer] use the indirect caller-callee counter as an independent search ↵Kostya Serebryany2015-10-221-0/+1
| | | | | | heuristic llvm-svn: 251078
* [libFuzzer] remove the deprecated 'tokens' featureKostya Serebryany2015-10-221-31/+0
| | | | llvm-svn: 251069
* Make a bunch of static arrays const.Craig Topper2015-10-181-1/+1
| | | | llvm-svn: 250642
OpenPOWER on IntegriCloud