summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lib/fuzzer] Fix logging for FuchsiaPetr Hosek2018-10-021-6/+15
| | | | | | | | | | | | | | | | | This change fixes two aspects of logging on Fuchsia: 1. When logging to stdout, the output file descriptor should not be closed in ExecuteCommand, as it prevent fdio_spawn_etc from succeeding in subsequent calls. 2. When logging to a file in anything other than standalone Zircon, the log file needs to be created in mutable storage. The best indicator where this is relative to the Fuchsia component will be given by '-artifact_prefix=...', so save the log file relative to that path. Patch by: aarongreen Differential Revision: https://reviews.llvm.org/D52562 llvm-svn: 343607
* [sanitizer][fuzzer] Transition back to ZX_TIME_INFINITEPetr Hosek2018-08-271-7/+4
| | | | | | | | | | Now that all Zircon calls have been transitioned to take time as signed value, we can transition back to ZX_TIME_INFINITE, undoing the change made in r337802. Differential Revision: https://reviews.llvm.org/D51266 llvm-svn: 340764
* [sanitizer][fuzzer] Temporarily transition to ZX_TIME_INFINITE_OLDPetr Hosek2018-07-241-4/+7
| | | | | | | | | | | This is a preparation for breaking change when all Zircon calls that take time as an argument will start using signed valued. We will transition back to ZX_TIME_INFITINE after all the changes to these symbols are done and become part of the Fuchsia SDK. Differential Revision: https://reviews.llvm.org/D49694 llvm-svn: 337802
* [Fuzzer] Improve crash unwinding on FuchsiaPetr Hosek2018-07-181-36/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | Fuchsia doesn't have signals; instead it expects processes to have a dedicated exception thread that binds to the process' exception port and waits for exception packets to be delivered. On the other hand, libFuzzer and sanitizer_common use expect to collect crash information via libunwind from the same thread that caused the exception. The long term fix is to improve support for remote unwinding in libunbwind, plumb this through sanitizer_common and libFuzzer, and handle the exception exclusively on the exception thread. In the meantime, this revision has the exception thread "resurrect" the crashing thread by: * saving its general purpose register state onto the crashing thread's stack, * setting the crashing thread's program counter to an assembly trampoline with the CFI information needed by libunwind, and * resuming the crashed thread. Patch By: aarongreen Differential Revision: https://reviews.llvm.org/D48509 llvm-svn: 337418
* [Fuzzer] Update the header path for fdio/spawn.h on FuchsiaPetr Hosek2018-06-071-1/+1
| | | | | | | | The path now includes lib/ prefix. Differential Revision: https://reviews.llvm.org/D47866 llvm-svn: 334213
* [Fuzzer] Migrate Fuchsia port from launchpad to fdio_spawnPetr Hosek2018-06-021-19/+36
| | | | | | | | fdio_spawn is the new public API for launching processes in Fuchsia. Differential Revision: https://reviews.llvm.org/D47649 llvm-svn: 333809
* [Fuzzer] Update _zx_port_wait function use in Fuchsia portPetr Hosek2018-05-261-5/+5
| | | | | | | | | Fuchsia's _zx_port_wait no longer takes the count argument. This change also updates all symbol uses to use the underscored versions. Differential Revision: https://reviews.llvm.org/D47403 llvm-svn: 333328
* [Fuzzer] Add a missing header in Fuchsia implementationPetr Hosek2018-04-201-0/+1
| | | | | | | | This is needed for fd_set. Differential Revision: https://reviews.llvm.org/D45852 llvm-svn: 330383
* [Fuzzer] Make InterruptHandler non-blocking for FuchsiaPetr Hosek2018-04-191-1/+6
| | | | | | | | | | | | | The initial naive approach to simulate SIGINT on Fuchsia was to getchar and look for ETX. This caused the InterruptHandler thread to lock stdin, preventing musl's exit() from being able to close the stdio descriptors and complete. This change uses select() instead. Patch By: aarongreen Differential Revision: https://reviews.llvm.org/D45636 llvm-svn: 330328
* [Fuzzer] Use Zircon's public API on FuchsiaPetr Hosek2018-02-071-31/+43
| | | | | | | | | | The original libFuzzer Fuchsia port relied on convenience libraries, but these are not exported as part of Fuchsia sysroot. This change eliminates the use of these libraries and relies on public API only. Differential Revision: https://reviews.llvm.org/D42996 llvm-svn: 324454
* [fuzzer] Update and enable libFuzzer on FuchsiaPetr Hosek2018-01-301-3/+3
| | | | | | | | | | | | | This change updates the Fuchsia-specific code to use the C++ friendly duration expressions and flips on the building of libclang_rt.fuzzer-x86_64.a and similar for Fuchsia. Given that compiler-rt doesn't build on Fuchsia, test have been run by explicitly building the library and linking it against lib/fuzzer/tests/FuzzerUnittest.cpp. Differential Revision: https://reviews.llvm.org/D42670 llvm-svn: 323828
* [libFuzzer] Add support for Fuchsia OS.Matt Morehouse2017-12-081-0/+228
Summary: This patch adds the initial support for Fuchsia. - LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h - Fuchsia is, by design, not POSIX compliant. However, it does use ELF and supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and FuzzerIO.h are implemented by extending the header guards in FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include LIBFUZZER_FUCHSIA. - The platform-specific portions of FuzzerUtil.h are implemented by FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and the launchpad library. - The experimental equivalence server is not currently supported, so FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp. Any future implementation will likely involve VMOs. Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer. Patch By: aarongreen Reviewers: kcc, morehouse, flowerhack, phosek Reviewed By: kcc, phosek, Eugene.Zelenko Subscribers: srhines, mgorny, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D40974 llvm-svn: 320210
OpenPOWER on IntegriCloud