mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-05 19:29:54 +00:00
f2c03c3bb0
I added a new flag RunningCB to know if the Fuzzer's main thread is running the CB function, instead of using (!CurrentUnitSize). (!CurrentUnitSize) doesn't work properly. For example, in FuzzerLoop.cpp, inside ShuffleAndMinimize() function, we execute the callback with an empty string (size=0). Previous implementation failed to detect timeouts in that execution. Also, I add a regression test for that case. Differential Revision: https://reviews.llvm.org/D27433 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289561 91177308-0d34-0410-b5e6-96231b3b80d8
20 lines
885 B
Plaintext
20 lines
885 B
Plaintext
RUN: not LLVMFuzzer-TimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=TimeoutTest
|
|
TimeoutTest: ALARM: working on the last Unit for
|
|
TimeoutTest: Test unit written to ./timeout-
|
|
TimeoutTest: == ERROR: libFuzzer: timeout after
|
|
TimeoutTest: #0
|
|
TimeoutTest: #1
|
|
TimeoutTest: #2
|
|
TimeoutTest: SUMMARY: libFuzzer: timeout
|
|
|
|
RUN: not LLVMFuzzer-TimeoutTest -timeout=1 %S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInputTimeoutTest
|
|
SingleInputTimeoutTest: ALARM: working on the last Unit for {{[1-3]}} seconds
|
|
SingleInputTimeoutTest-NOT: Test unit written to ./timeout-
|
|
|
|
RUN: LLVMFuzzer-TimeoutTest -timeout=1 -timeout_exitcode=0
|
|
|
|
RUN: not LLVMFuzzer-TimeoutEmptyTest -timeout=1 2>&1 | FileCheck %s --check-prefix=TimeoutEmptyTest
|
|
TimeoutEmptyTest: ALARM: working on the last Unit for
|
|
TimeoutEmptyTest: == ERROR: libFuzzer: timeout after
|
|
TimeoutEmptyTest: SUMMARY: libFuzzer: timeout
|