[PATCH] D45744: Add experimental feature to not use AFL's deferred forkserver.
Jonathan Metzman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 17 18:45:54 PDT 2018
metzman updated this revision to Diff 142876.
metzman added a comment.
- Don't manually init the forkserver if we are not using the deferred one.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D45744
Files:
lib/fuzzer/afl/afl_driver.cpp
Index: lib/fuzzer/afl/afl_driver.cpp
===================================================================
--- lib/fuzzer/afl/afl_driver.cpp
+++ lib/fuzzer/afl/afl_driver.cpp
@@ -138,6 +138,17 @@
static const char *kExtraStatsFormatString = "peak_rss_mb : %u\n"
"slowest_unit_time_sec : %u\n";
+// Experimental feature to use afl_driver without AFL's deferred mode.
+// Needs to run before __afl_auto_init.
+__attribute__((constructor(0))) void __decide_deferred_forkserver(void) {
+ if (getenv("AFL_DRIVER_DONT_DEFER")) {
+ if (unsetenv("__AFL_DEFER_FORKSRV")) {
+ perror("Failed to unset __AFL_DEFER_FORKSRV");
+ abort();
+ }
+ }
+}
+
// Copied from FuzzerUtil.cpp.
size_t GetPeakRSSMb() {
struct rusage usage;
@@ -315,7 +326,8 @@
maybe_duplicate_stderr();
maybe_initialize_extra_stats();
- __afl_manual_init();
+ if (!getenv("AFL_DRIVER_DONT_DEFER"))
+ __afl_manual_init();
int N = 1000;
if (argc == 2 && argv[1][0] == '-')
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45744.142876.patch
Type: text/x-patch
Size: 1030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180418/ecaf8c5c/attachment.bin>
More information about the llvm-commits
mailing list