Skip to content

Commit

Permalink
[libFuzzer] Add attribute noinline on Fuzzer::ExecuteCallback().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JonPsson committed Mar 12, 2021
1 parent f08dadd commit 5908c7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler-rt/lib/fuzzer/FuzzerLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5908c7c

Please sign in to comment.