summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerIO.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libFuzzer] Clean up headers and file formatting of LibFuzzer files.Marcos Pividori2016-12-131-1/+2
| | | | | | | | | | | | Reorganize #includes to follow LLVM Coding Standards. Include some missing headers. Required to use `Printf()`. Aside from that, this patch contains no functional change. It is purely a re-organization. Differential Revision: https://reviews.llvm.org/D27363 llvm-svn: 289560
* [LibFuzzer] Add Windows implementations of some IO functions.Zachary Turner2016-11-301-44/+10
| | | | | | | | | | | | | This patch moves some posix specific file i/o code into a new file, FuzzerIOPosix.cpp, and provides implementations for these functions on Windows in FuzzerIOWindows.cpp. This is another incremental step towards getting libfuzzer working on Windows, although it still should not be expected to be fully working. Patch by Marcos Pividori Differential Revision: https://reviews.llvm.org/D27233 llvm-svn: 288275
* [LibFuzzer] Split up some functions among different headers.Zachary Turner2016-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | In an effort to get libfuzzer working on Windows, we need to make a distinction between what functions require platform specific code (e.g. different code on Windows vs Linux) and what code doesn't. IO functions, for example, tend to be platform specific. This patch separates out some of the functions which will need to have platform specific implementations into different headers, so that we can then provide different implementations for each platform. Aside from that, this patch contains no functional change. It is purely a re-organization. Patch by Marcos Pividori Differential Revision: https://reviews.llvm.org/D27230 llvm-svn: 288264
* [libFuzzer] when shrinking the corpus, delete evicted files previously ↵Kostya Serebryany2016-10-081-4/+10
| | | | | | created by the current process llvm-svn: 283682
* [libFuzzer] more refactoring; NFCKostya Serebryany2016-09-211-1/+1
| | | | llvm-svn: 282047
* [libFuzzer] refactoring: move the Corpus into a separate class; delete two ↵Kostya Serebryany2016-09-211-1/+1
| | | | | | unused experimental features llvm-svn: 282042
* [LibFuzzer] Declare and use sanitizer functions in ``fuzzer::ExternalFunctions``Dan Liew2016-06-071-6/+3
| | | | | | | | | | | | | | | | | | | | | | | This fixes linking problems on OSX. Unfortunately it turns out we need to use an instance of the ``fuzzer::ExternalFunctions`` object in several places so this commit also replaces all instances with a single global instance. It also turns out initializing a global ``fuzzer::ExternalFunctions`` before main is entered (i.e. letting the object be initialised by the global initializers) is not safe (on OSX the call to ``Printf()`` in the CTOR crashes if it is called from a global initializer) so we instead have a global ``fuzzer::ExternalFunctions*`` and initialize it inside ``FuzzerDriver()``. Multiple unit tests depend also depend on the ``fuzzer::ExternalFunctions*`` global so a ``main()`` function has been added that initializes it before running any tests. Differential Revision: http://reviews.llvm.org/D20943 llvm-svn: 272072
* [libFuzzer] use __sanitizer_set_report_fd with -close_fd_mask. This allows ↵Kostya Serebryany2016-05-271-0/+6
| | | | | | us to keep asan reports when closing target's stderr llvm-svn: 271053
* [libFuzzer] use fflush after every PrintfKostya Serebryany2016-03-251-0/+1
| | | | llvm-svn: 264459
* [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-181-1/+17
| | | | | | by closing stderr/stdout llvm-svn: 263831
* [libFuzzer] read corpus dirs recursivelyKostya Serebryany2016-03-181-14/+16
| | | | llvm-svn: 263773
* [libfuzzer] speeding up corpus loadMike Aizatsky2016-03-151-8/+10
| | | | llvm-svn: 263591
* [libFuzzer] log less when re-loading files; fix a silly bug: when running ↵Kostya Serebryany2016-03-041-2/+4
| | | | | | single files actually run all of them, not just the first one llvm-svn: 262754
* [libFuzzer] only read MaxLen bytes from every file in the corpus to speedup ↵Kostya Serebryany2016-02-181-4/+10
| | | | | | loading the corpus llvm-svn: 261267
* [libFuzzer] don't timeout when loading the corpus. Be a bit more verbose ↵Kostya Serebryany2016-02-171-1/+5
| | | | | | when loading large corpus. llvm-svn: 261143
* [libFuzzer] allow passing 1 or more files as individual inputsKostya Serebryany2016-02-021-0/+7
| | | | llvm-svn: 259459
* [libFuzzer] fail if the corpus dir does not existKostya Serebryany2016-02-021-1/+1
| | | | llvm-svn: 259454
* [libFuzzer] compute base64 in-process instead of using an external lib. ↵Kostya Serebryany2015-12-041-5/+0
| | | | | | Since libFuzzer should not depend on anything, just re-implement base64 encoder. PR25746 llvm-svn: 254784
* [libFuzzer] make libFuzzer build even with a compiler that does not have ↵Kostya Serebryany2015-11-131-0/+1
| | | | | | sanitizer headers llvm-svn: 253003
* [libFuzzer] When -test_single_input crashes the test it is not necessary to ↵Kostya Serebryany2015-10-161-0/+4
| | | | | | write crash-file because input is already known to the user. Patch by Mike Aizatsky llvm-svn: 250564
* [libFuzzer] be more robust when dealing with files on disk (e.g. don't crash ↵Kostya Serebryany2015-09-081-4/+2
| | | | | | if a file was there but disappeared) llvm-svn: 247066
* [libFuzzer] fix minor inefficiency, PR24584Kostya Serebryany2015-08-261-1/+1
| | | | llvm-svn: 246087
* [libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.Kostya Serebryany2015-08-121-2/+5
| | | | llvm-svn: 244707
* [libFuzzer] require the files and directories passed to the fuzzer to existKostya Serebryany2015-07-181-2/+8
| | | | llvm-svn: 242596
* [lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ ↵Kostya Serebryany2015-05-231-4/+9
| | | | | | library used in libFuzzer badly interract with the same code used in the target function and also with dfsan. It's easier to just not use std::cerr than to defeat these issues. llvm-svn: 238078
* [lib/Fuzzer] when -sync_command=<CMD> is given, periodically execute 'CMD ↵Kostya Serebryany2015-05-181-1/+1
| | | | | | CORPUS' to synchronize with other processes llvm-svn: 237617
* [lib/Fuzzer] use -fsanitize-coverage=trace-cmp when building LLVM with ↵Kostya Serebryany2015-05-081-4/+25
| | | | | | LLVM_USE_SANITIZE_COVERAGE; in lib/Fuzzer try to reload the corpus to pick up new units from other processes llvm-svn: 236906
* [lib/Fuzzer] on crash print the contents of the crashy input as base64Kostya Serebryany2015-05-051-0/+5
| | | | llvm-svn: 236548
* [fuzzer] Add support for token-based fuzzing (e.g. for C++). Allow string ↵Kostya Serebryany2015-03-311-0/+6
| | | | | | flags. llvm-svn: 233745
* [fuzzer] make multi-process execution more verbose; fix mutation to actually ↵Kostya Serebryany2015-02-041-0/+8
| | | | | | respect mutation depth and to never produce empty units llvm-svn: 228170
* Reverting r227452, which adds back the fuzzer library. Now excluding the ↵Aaron Ballman2015-01-291-0/+49
| | | | | | fuzzer library based on LLVM_USE_SANITIZE_COVERAGE being set or unset. llvm-svn: 227464
* Temporarily reverting the fuzzer library as it causes too many build issues ↵Aaron Ballman2015-01-291-49/+0
| | | | | | for MSVC users. This reverts: 227445, 227395, 227389, 227357, 227254, 227252 llvm-svn: 227452
* [fuzzer] add option -save_minimized_corpusKostya Serebryany2015-01-281-2/+7
| | | | llvm-svn: 227395
* Add a Fuzzer libraryKostya Serebryany2015-01-271-0/+44
Summary: A simple genetic in-process coverage-guided fuzz testing library. I've used this fuzzer to test clang-format (it found 12+ bugs, thanks djasper@ for the fixes!) and it may also help us test other parts of LLVM. So why not keep it in the LLVM repository? I plan to add the cmake build rules later (in a separate patch, if that's ok) and also add a clang-format-fuzzer target. See README.txt for details. Test Plan: Tests will follow separately. Reviewers: djasper, chandlerc, rnk Reviewed By: rnk Subscribers: majnemer, ygribov, dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D7184 llvm-svn: 227252
OpenPOWER on IntegriCloud