[compiler-rt] 2d6dfce - [libFuzzer] Remove entropic-scale-per-exec-time.test.

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 12:20:25 PST 2021


Author: Matt Morehouse
Date: 2021-12-09T12:20:06-08:00
New Revision: 2d6dfce4aa078d18db29e451d761a9d1dcd308b6

URL: https://github.com/llvm/llvm-project/commit/2d6dfce4aa078d18db29e451d761a9d1dcd308b6
DIFF: https://github.com/llvm/llvm-project/commit/2d6dfce4aa078d18db29e451d761a9d1dcd308b6.diff

LOG: [libFuzzer] Remove entropic-scale-per-exec-time.test.

The test has been flaky for years, and I think we should remove it to
eliminate noise on the buildbot.

Neither me nor dokyungs have been able to fully deflake the test, and it
tests a non-default Entropic flag.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D115453

Added: 
    

Modified: 
    

Removed: 
    compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
    compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test


################################################################################
diff  --git a/compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp b/compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
deleted file mode 100644
index 44d58a0874539..0000000000000
--- a/compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-// Tests whether scaling the Entropic scheduling weight based on input execution
-// time is effective or not. Inputs of size less than 7 will take at least 100
-// microseconds more than inputs of size greater than or equal to 7. Inputs of
-// size greater than 7 in the corpus should be favored by the exec-time-scaled
-// Entropic scheduling policy than the input of size less than 7 in the corpus,
-// eventually finding the crashing input with less executions.
-#include <chrono>
-#include <cstdint>
-#include <thread>
-
-static volatile int Sink;
-static volatile int *Nil = nullptr;
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
-  if (Size > 10)
-    return 0; // To make the test quicker.
-
-  if (Size < 7) {
-    // execute a lot slower than the crashing input below.
-    size_t ExecTimeUSec = 100;
-    std::this_thread::sleep_for(std::chrono::microseconds(ExecTimeUSec));
-    Sink = 7;
-
-    if (Size > 0 && Data[0] == 0xaa && Size > 1 && Data[1] == 0xbb &&
-        Size > 2 && Data[2] == 0xcc && Size > 3 && Data[3] == 0xdd &&
-        Size > 4 && Data[4] == 0xee && Size > 5 && Data[5] == 0xff)
-      Sink += 7;
-  }
-
-  // Give unique coverage for each input of size (7, 8, 9, 10)
-  if (Size == 7)
-    Sink = -7;
-
-  if (Size == 8)
-    Sink = -8;
-
-  if (Size == 9)
-    Sink = -9;
-
-  if (Size == 10)
-    Sink = -10;
-
-  if (Sink < 0 && Data[0] == 0xab && Data[1] == 0xcd)
-    *Nil = 42; // crash.
-
-  return 0;
-}

diff  --git a/compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test b/compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test
deleted file mode 100644
index d8baf59da97a9..0000000000000
--- a/compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test
+++ /dev/null
@@ -1,8 +0,0 @@
-REQUIRES: linux, x86_64
-RUN: %cpp_compiler %S/EntropicScalePerExecTimeTest.cpp -o %t-EntropicScalePerExecTimeTest
-RUN: not %run %t-EntropicScalePerExecTimeTest -entropic=1 -entropic_scale_per_exec_time=1 -seed=1 -runs=200000 -max_len=10
-
-# Without -entropic_scale_per_exec_time=1, the crash takes longer to find since
-# the slow path is explored first.  This test is disabled because it sometimes
-# finds the bug under certain configs.
-DISABLED: %run %t-EntropicScalePerExecTimeTest -entropic=1 -seed=1 -runs=200000 -max_len=10


        


More information about the llvm-commits mailing list