[llvm] r272726 - Revert "Enable libFuzzer's afl_driver to append stderr to a file."
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 15:09:00 PDT 2016
Author: vitalybuka
Date: Tue Jun 14 17:09:00 2016
New Revision: 272726
URL: http://llvm.org/viewvc/llvm-project?rev=272726&view=rev
Log:
Revert "Enable libFuzzer's afl_driver to append stderr to a file."
Crashes with AddressSanitizer: SEGV on unknown address
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/9924/steps/annotate/logs/stdio
This reverts commit r272706.
Removed:
llvm/trunk/lib/Fuzzer/test/AFLDriverTest.cpp
llvm/trunk/lib/Fuzzer/test/afl-driver.test
Modified:
llvm/trunk/lib/Fuzzer/afl/afl_driver.cpp
llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
Modified: llvm/trunk/lib/Fuzzer/afl/afl_driver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/afl/afl_driver.cpp?rev=272726&r1=272725&r2=272726&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/afl/afl_driver.cpp (original)
+++ llvm/trunk/lib/Fuzzer/afl/afl_driver.cpp Tue Jun 14 17:09:00 2016
@@ -60,25 +60,6 @@ static volatile char suppress_warning1 =
static const size_t kMaxAflInputSize = 1 << 20;
static uint8_t AflInputBuf[kMaxAflInputSize];
-// If the user asks us to duplicate stderr, then do it.
-static void maybe_duplicate_stderr() {
- char* stderr_duplicate_filename =
- getenv("AFL_DRIVER_STDERR_DUPLICATE_FILENAME");
-
- if (!stderr_duplicate_filename)
- return;
-
- FILE* stderr_duplicate_stream =
- freopen(stderr_duplicate_filename, "a+", stderr);
-
- if (!stderr_duplicate_stream) {
- fprintf(stderr,
- "Failed to duplicate stderr to AFL_DRIVER_STDERR_DUPLICATE_FILENAME"
- );
- abort();
- }
-}
-
int main(int argc, char **argv) {
fprintf(stderr, "Running in AFl-fuzz mode\nUsage:\n"
"afl-fuzz [afl-flags] %s [N] "
@@ -89,8 +70,6 @@ int main(int argc, char **argv) {
LLVMFuzzerInitialize(&argc, &argv);
// Do any other expensive one-time initialization here.
- maybe_duplicate_stderr();
-
__afl_manual_init();
int N = 1000;
Removed: llvm/trunk/lib/Fuzzer/test/AFLDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/AFLDriverTest.cpp?rev=272725&view=auto
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/AFLDriverTest.cpp (original)
+++ llvm/trunk/lib/Fuzzer/test/AFLDriverTest.cpp (removed)
@@ -1,12 +0,0 @@
-#include <stdint.h>
-#include <stdlib.h>
-
-extern "C" void __afl_manual_init() {}
-
-extern "C" int __afl_persistent_loop(unsigned int) {
- return 0;
-}
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
- return 0;
-}
Modified: llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/CMakeLists.txt?rev=272726&r1=272725&r2=272726&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/CMakeLists.txt (original)
+++ llvm/trunk/lib/Fuzzer/test/CMakeLists.txt Tue Jun 14 17:09:00 2016
@@ -110,19 +110,6 @@ foreach(Test ${Tests})
endforeach()
###############################################################################
-# AFL Driver test
-###############################################################################
-
-add_executable(AFLDriverTest
- AFLDriverTest.cpp ../afl/afl_driver.cpp)
-
-set_target_properties(AFLDriverTest
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY
- "${CMAKE_BINARY_DIR}/lib/Fuzzer/test"
- )
-set(TestBinaries ${TestBinaries} AFLDriverTest)
-
-###############################################################################
# Unit tests
###############################################################################
Removed: llvm/trunk/lib/Fuzzer/test/afl-driver.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/afl-driver.test?rev=272725&view=auto
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/afl-driver.test (original)
+++ llvm/trunk/lib/Fuzzer/test/afl-driver.test (removed)
@@ -1,10 +0,0 @@
-; Test that not specifying a file isn't broken.
-RUN: unset AFL_DRIVER_STDERR_DUPLICATE_FILENAME
-RUN: AFLDriverTest
-
-; Test that specifying an invalid file causes a crash.
-RUN: AFL_DRIVER_STDERR_DUPLICATE_FILENAME="%T" not --crash AFLDriverTest
-
-; Test that a file is created when specified as the duplicate stderr.
-RUN: AFL_DRIVER_STDERR_DUPLICATE_FILENAME=%t AFLDriverTest
-RUN: stat %t
More information about the llvm-commits
mailing list