Skip to content

Commit 5908c7c

Browse files
committed
[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
1 parent f08dadd commit 5908c7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/lib/fuzzer/FuzzerLoop.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,10 @@ static bool LooseMemeq(const uint8_t *A, const uint8_t *B, size_t Size) {
578578
!memcmp(A + Size - Limit / 2, B + Size - Limit / 2, Limit / 2);
579579
}
580580

581-
void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) {
581+
// This method is not inlined because it would cause a test to fail where it
582+
// is part of the stack unwinding. See D97975 for details.
583+
void __attribute__((noinline))
584+
Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) {
582585
TPC.RecordInitialStack();
583586
TotalNumberOfRuns++;
584587
assert(InFuzzingThread());

0 commit comments

Comments
 (0)