summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer
Commit message (Collapse)AuthorAgeFilesLines
* [LibFuzzer] Refactor declaration of tests in CMake.Dan Liew2016-05-276-115/+104
| | | | | | | | | | | | | | | | | | Add a new CMake function (``add_libfuzzer_test()``) to simplify declaration of executables for testing LibFuzzer and use it to reorganise how tests are declared. Note that configuration of the lit configuration files has been moved as late as possible because we are going to need to disable some tests for some platforms and we will need to propagate this information into the lit configuration. Note the code for custom mains was removed because no tests are currently written for this and Kostya seems happy to remove this. Differential Revision: http://reviews.llvm.org/D20706 llvm-svn: 270958
* [libFuzzer] make check-fuzzer a bit fasterKostya Serebryany2016-05-271-3/+2
| | | | llvm-svn: 270947
* [libFuzzer] make OOM-handling more portable. Instead of sending a signal to ↵Kostya Serebryany2016-05-273-55/+21
| | | | | | the main fuzzing thread, print the message in the getrusage thread and exit. llvm-svn: 270945
* [libFuzzer] more refactoring: make sure CurrentUnitData is awlays a valid ↵Kostya Serebryany2016-05-273-15/+26
| | | | | | pointer to read from llvm-svn: 270942
* [libFuzzer] more refactoring around CurrentUnit. Also add a threading test ↵Kostya Serebryany2016-05-265-25/+63
| | | | | | on which we currently have a race (when reporting bugs from multiple threads) llvm-svn: 270929
* [LibFuzzer] Add missing #include<string>Dan Liew2016-05-261-0/+1
| | | | | | | This partially fixes the compilation of the LibFuzzer unit test on OSX using AppleClang. llvm-svn: 270926
* [libFuzzer] refactor: hide CurrentUnitData inside an interface function. NFCKostya Serebryany2016-05-263-28/+37
| | | | llvm-svn: 270922
* [LibFuzzer] Emit error if LLVM_USE_SANITIZER is not correctly set.Dan Liew2016-05-261-0/+6
| | | | | | | | | | Previously CMake would successfully configure and compile (with warnings about ``-fsanitize-coverage=...`` being unused) but the tests LibFuzzer tests would fail. Differential Revision: http://reviews.llvm.org/D20662 llvm-svn: 270913
* [LibFuzzer] Allow LibFuzzer to be built in modes other than RELEASE.Dan Liew2016-05-267-14/+37
| | | | | | | | | | | | Previously the flags were only being set correctly when the build type was "Release". Now the build should work properly for all the supported build types. When building libFuzzer the optimization level respects whatever is used for the rest of LLVM but for the LibFuzzer tests we force -O0. Differential Revision: http://reviews.llvm.org/D20558 llvm-svn: 270912
* [libFuzzer] when there is a leak in the existing corpus report the ↵Kostya Serebryany2016-05-263-23/+12
| | | | | | reproducer properly llvm-svn: 270905
* [libFuzzer] reimplement the way we do -only_ascii to allow more 'const' in ↵Kostya Serebryany2016-05-265-13/+20
| | | | | | function declarations. Add a test for -only_ascii. NFC intended llvm-svn: 270900
* [libfuzzer] replacing unittest for truncate_units with functional test.Mike Aizatsky2016-05-254-22/+22
| | | | | | Differential Revision: http://reviews.llvm.org/D20641 llvm-svn: 270755
* [libFuzzer] print stats if we crash on empty inputKostya Serebryany2016-05-254-3/+27
| | | | llvm-svn: 270639
* [libfuzzer] Trying random unit prefixes during corpus load.Mike Aizatsky2016-05-245-1/+72
| | | | | | Differential Revision: http://reviews.llvm.org/D20301 llvm-svn: 270632
* [libFuzzer] add a license header to afl/afl_driver.cppKostya Serebryany2016-05-241-0/+8
| | | | llvm-svn: 270598
* [LibFuzzer] Fix implementation of ``GetPeakRSSMb()`` on Mac OSX.Dan Liew2016-05-201-1/+9
| | | | | | | | On Linux ``rusage.ru_maxrss`` is in KiB but on Mac OSX it is in bytes. Differential Revision: http://reviews.llvm.org/D20410 llvm-svn: 270173
* [LibFuzzer] Fix ``NumberOfCpuCores()`` on Mac OSX.Dan Liew2016-05-201-4/+29
| | | | | | | | | | | | | | | The ``nprocs`` command does not exist under Mac OSX so use ``sysctl`` instead on that platform. Whilst I'm here * Use ``pclose()`` instead of ``fclose()`` which the ``popen()`` documentation says should be used. * Check for errors that were previously unhandled. Differential Revision: http://reviews.llvm.org/D20409 llvm-svn: 270172
* [LibFuzzer]Dan Liew2016-05-192-2/+23
| | | | | | | | | | | | | | | | | | Work around crashes in ``__sanitizer_malloc_hook()`` under Mac OSX. Under Mac OSX we intercept calls to malloc before thread local storage is initialised leading to a crash when accessing ``AllocTracer``. To workaround this ``AllocTracer`` is only accessed in the hook under Linux. For symmetry ``__sanitizer_free_hook()`` is also modified in the same way. To support this change a set of new macros LIBFUZZER_LINUX and LIBFUZZER_APPLE has been defined which can be used to check the target being compiled for. Differential Revision: http://reviews.llvm.org/D20402 llvm-svn: 270145
* [libFuzzer] do the merge faster and a bit less preciseKostya Serebryany2016-05-131-1/+2
| | | | llvm-svn: 269497
* [libFuzzer] print the file name before executing the input so that if there ↵Kostya Serebryany2016-05-132-3/+4
| | | | | | is a crash we know which files has caused it llvm-svn: 269450
* [libFuzzer] simplify FuzzerInterface.hKostya Serebryany2016-05-136-79/+43
| | | | llvm-svn: 269448
* [libFuzzer] add a driver file to use AFL on LLVMFuzzerTestOneInputKostya Serebryany2016-05-101-0/+82
| | | | llvm-svn: 269141
* [libfuzzer] Refactoring coverage state-management code.Mike Aizatsky2016-05-104-116/+206
| | | | | | | | | It is now less state-dependent and will allow easier comparing of coverages of different units. Differential Revision: http://reviews.llvm.org/D20085 llvm-svn: 269140
* [libFuzzer] add a test for libFuzzer+ubsan, extend the docs on using ↵Kostya Serebryany2016-05-094-0/+56
| | | | | | libFuzzer+ubsan llvm-svn: 268968
* [libFuzzer] better document the -merge=1 flagKostya Serebryany2016-05-091-1/+2
| | | | llvm-svn: 268957
* [libFuzzer] enhance -rss_limit_mb and enable by default. Now it will print ↵Kostya Serebryany2016-05-068-15/+82
| | | | | | the OOM reproducer. llvm-svn: 268821
* [libFuzzer] add exeprimental -rss_limit_mb flag to fight against OOMsKostya Serebryany2016-05-064-0/+31
| | | | llvm-svn: 268807
* [libFuzzer] print stats after running individual inputsKostya Serebryany2016-05-043-2/+7
| | | | llvm-svn: 268547
* [libFuzzer] enable detect_leaks=1, add proper docsKostya Serebryany2016-04-293-3/+3
| | | | llvm-svn: 268088
* [libFuzzer] disable leak detection if we have tried it for 1000 times w/o ↵Kostya Serebryany2016-04-271-1/+2
| | | | | | finding a leak [part 2] llvm-svn: 267771
* [libFuzzer] disable leak detection if we have tried it for 1000 times w/o ↵Kostya Serebryany2016-04-274-0/+28
| | | | | | finding a leak llvm-svn: 267770
* [libFuzzer] remove dead codeKostya Serebryany2016-04-252-5/+2
| | | | llvm-svn: 267455
* [libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, ↵Kostya Serebryany2016-04-206-5/+103
| | | | | | it will help finding leaks while fuzzing llvm-svn: 266838
* [libFuzzer] try to print correct time in seconds when reporting a timeout. ↵Kostya Serebryany2016-04-183-6/+6
| | | | | | Don't report timeouts while still loading the corpus. llvm-svn: 266693
* [libFuzzer] warn if the corpus is emptyKostya Serebryany2016-04-182-1/+5
| | | | 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-152-0/+5
| | | | llvm-svn: 266480
* Remove redundant .c_str(), as suggested by PR25633Hans Wennborg2016-04-111-1/+1
| | | | llvm-svn: 265988
* [libfuzzer] defensive assertMike Aizatsky2016-04-081-1/+2
| | | | llvm-svn: 265866
* [libfuzzer] adding license headers to cpp filesMike Aizatsky2016-04-0127-0/+81
| | | | | | Differential Revision: http://reviews.llvm.org/D18705 llvm-svn: 265174
* [libFuzzer] more docsKostya Serebryany2016-03-291-1/+2
| | | | llvm-svn: 264803
* [libFuzzer] use fflush after every PrintfKostya Serebryany2016-03-251-0/+1
| | | | llvm-svn: 264459
* [libFuzzer] handle SIGTERMKostya Serebryany2016-03-244-0/+4
| | | | llvm-svn: 264338
* [libFuzzer] don't report memory leaks if we are dying due to a timeout (just ↵Kostya Serebryany2016-03-245-5/+25
| | | | | | use _Exit instead of exit in the timeout callback) llvm-svn: 264237
* [libFuzzer] use fdopen+vfprintf instead of fsnprintf+writeKostya Serebryany2016-03-241-11/+10
| | | | llvm-svn: 264230
* [libFuzzer] add a flag close_fd_mask so that we can silence spammy targets ↵Kostya Serebryany2016-03-187-1/+74
| | | | | | by closing stderr/stdout llvm-svn: 263831
* [Fuzzer] Guard no_sanitize_memory attributes behind __has_feature.Benjamin Kramer2016-03-181-2/+10
| | | | | | Otherwise GCC fails to build it because it doesn't know the attribute. llvm-svn: 263787
* [libFuzzer] read corpus dirs recursivelyKostya Serebryany2016-03-182-14/+25
| | | | llvm-svn: 263773
* [libFuzzer] improve -merge functionalityKostya Serebryany2016-03-186-73/+101
| | | | llvm-svn: 263769
* [libFuzzer] deprecate several flagsKostya Serebryany2016-03-177-51/+10
| | | | llvm-svn: 263739
OpenPOWER on IntegriCloud