summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerIOWindows.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libFuzzer] don't use /dev/null for DiscardOuput in Fuchsia.Marco Vanotti2019-11-211-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit moves the `DiscardOutput` function in FuzzerIO to FuzzerUtil, so fuchsia can have its own specialized version. In fuchsia, accessing `/dev/null` is not supported, and there's nothing similar to a file that discards everything that is written to it. The way of doing something similar in fuchsia is by using `fdio_null_create` and binding that to a file descriptor with `fdio_bind_to_fd`. This change should fix one of the issues with the `-close_fd_mask` flag in libfuzzer, in which closing stdout was not working due to `fopen("/dev/null", "w")` returning `NULL`. Reviewers: kcc, aarongreen Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69593
* [libFuzzer] add -features_dir= flag to dump unique input features on diskKostya Serebryany2019-04-131-0/+4
| | | | llvm-svn: 358317
* [libFuzzer][Windows] Port fork mode to WindowsJonathan Metzman2019-02-271-6/+65
| | | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer's fork mode to Windows. Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this. Don't print error messages under new normal uses of FileSize (on a non-existent file). Implement portable way of piping output to /dev/null. Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win. Reviewers: zturner Reviewed By: zturner Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58513 llvm-svn: 355019
* [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time ↵Kostya Serebryany2019-02-151-1/+1
| | | | | | flag, print the number of ooms/timeouts/crashes, fix a typo llvm-svn: 354175
* [libFuzzer] a bit of refactoring of the fork modeKostya Serebryany2019-02-131-0/+9
| | | | llvm-svn: 353910
* [libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany2019-02-121-0/+8
| | | | | | good enough for the first unit test llvm-svn: 353775
* [libFuzzer][Windows] Clean up RawPrintJonathan Metzman2019-02-041-2/+1
| | | | | | | | | | | | | | | | Summary: Use `_write` instead of the deprecated alias `write` on Windows. Also, remove comment saying RawPrint is untested on Windows. Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka Differential Revision: https://reviews.llvm.org/D57589 llvm-svn: 353108
* [fuzzer] Use RawPrint instead of Printf for instrumentation warningJonathan Metzman2019-01-311-1/+1
| | | | | | | | | | | | | | | Summary: Use RawPrint instead of Printf for instrumentation warning because Printf doesn't work on Win when instrumentation is being initialized (since OutputFile is not yet initialized). Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D57531 llvm-svn: 352789
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [libFuzzer] Enable tests on WindowsMatt Morehouse2018-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable tests on Windows and make check-fuzzer pass on it. Make check-fuzzer pass on Windows by fixing libFuzzer, fixing tests, and by disabling tests on Windows. Most of these are disabled temporarily as support for the tests and the features they test will be added incrementally. Other tests will not be enabled since they require things that are not on Windows (eg: afl_driver tests). Every test that was explicitly disabled on Windows has a comment explaining why (unless obvious like merge-posix.test). The lit.cfg file was modified to support running tests on windows. fuzzer-dirs.test was fixed by making the Windows implementation print the same error message as the posix version. merge-control-file.test was fixed by making the test binary end with the ".exe" extension (on all platforms). Patch By: metzman Reviewers: morehouse Reviewed By: morehouse Subscribers: srhines, mgorny Differential Revision: https://reviews.llvm.org/D51549 llvm-svn: 341385
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-301-0/+20
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 341082
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-291-20/+0
| | | | | | This reverts r340949 due to bot breakage again. llvm-svn: 340954
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-291-0/+20
| | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340949
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-281-20/+0
| | | | | | This reverts commit r340860 due to failing tests. llvm-svn: 340867
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-281-0/+20
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340860
* [libFuzzer] Use custom allocators for STL containers in libFuzzer.George Karpenkov2017-08-271-1/+1
| | | | | | | | Avoids ODR violations causing spurious ASAN warnings. Differential Revision: https://reviews.llvm.org/D37086 llvm-svn: 311866
* Revert "[libFuzzer] Use custom allocators for STL containers in libFuzzer"George Karpenkov2017-08-261-1/+1
| | | | | | This reverts commit 3539efc2f2218dba2bcbd645d0fe276f2b5cf588. llvm-svn: 311831
* [libFuzzer] Use custom allocators for STL containers in libFuzzerGeorge Karpenkov2017-08-261-1/+1
| | | | | | | | Avoids ODR violations causing spurious ASAN container overflow warnings. Differential Revision: https://reviews.llvm.org/D37086 llvm-svn: 311830
* Move libFuzzer to compiler_rt.George Karpenkov2017-08-211-0/+323
Resulting library binaries will be named libclang_rt.fuzzer*, and will be placed in Clang toolchain, allowing redistribution. Differential Revision: https://reviews.llvm.org/D36908 llvm-svn: 311407
OpenPOWER on IntegriCloud