[compiler-rt] 5908c7c - [libFuzzer] Add attribute noinline on Fuzzer::ExecuteCallback().

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 19:07:58 PST 2021


Author: Jonas Paulsson
Date: 2021-03-11T21:05:22-06:00
New Revision: 5908c7ca41bd2dad93bd2f22f2f4692631701ec4

URL: https://github.com/llvm/llvm-project/commit/5908c7ca41bd2dad93bd2f22f2f4692631701ec4
DIFF: https://github.com/llvm/llvm-project/commit/5908c7ca41bd2dad93bd2f22f2f4692631701ec4.diff

LOG: [libFuzzer] Add attribute noinline on Fuzzer::ExecuteCallback().

The inlining of this function needs to be disabled as it is part of the
inpsected stack traces. It's string representation will look different
depending on if it was inlined or not which will cause it's string comparison
to fail.

When it was inlined in only one of the two execution stacks,
minimize_two_crashes.test failed on SystemZ. For details see
https://bugs.llvm.org/show_bug.cgi?id=49152.

Reviewers: Ulrich Weigand, Matt Morehouse, Arthur Eubanks

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

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerLoop.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
index 03bf4fc4576f..f5028261d81b 100644
--- a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
@@ -578,7 +578,10 @@ static bool LooseMemeq(const uint8_t *A, const uint8_t *B, size_t Size) {
          !memcmp(A + Size - Limit / 2, B + Size - Limit / 2, Limit / 2);
 }
 
-void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) {
+// This method is not inlined because it would cause a test to fail where it
+// is part of the stack unwinding. See D97975 for details.
+void __attribute__((noinline))
+Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) {
   TPC.RecordInitialStack();
   TotalNumberOfRuns++;
   assert(InFuzzingThread());


        


More information about the llvm-commits mailing list