llvm/lib/Fuzzer/test
Marcos Pividori f2c03c3bb0 [libFuzzer] Fix bug in detecting timeouts when input string is empty.
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
2016-12-13 17:46:25 +00:00
..
no-coverage [libFuzzer] switch all libFuzzer tests to use -fsanitize-coverage=trace-pc-guard. Support for the previosly used instrumentation will be removed in the following changes 2016-12-10 02:26:23 +00:00
ubsan
uninstrumented [libFuzzer] switch all libFuzzer tests to use -fsanitize-coverage=trace-pc-guard. Support for the previosly used instrumentation will be removed in the following changes 2016-12-10 02:26:23 +00:00
unit
AbsNegAndConstant64Test.cpp [libFuzzer] use sizeof() in tests instead of 4 and 8 2016-09-09 22:21:16 +00:00
AbsNegAndConstantTest.cpp [libFuzzer] use sizeof() in tests instead of 4 and 8 2016-09-09 22:21:16 +00:00
AccumulateAllocationsTest.cpp
afl-driver-extra-stats.test
afl-driver-stderr.test
AFLDriverTest.cpp
BufferOverflowOnInput.cpp
caller-callee.test [libFuzzer] don't depend on time in a test 2016-12-11 06:28:09 +00:00
CallerCalleeTest.cpp
CMakeLists.txt [libFuzzer] Fix bug in detecting timeouts when input string is empty. 2016-12-13 17:46:25 +00:00
CounterTest.cpp
coverage.test [libFuzzer] test cleanup 2016-12-10 02:45:56 +00:00
CustomCrossOverTest.cpp [libFuzzer] remove unused option 2016-09-30 22:29:57 +00:00
CustomMutatorTest.cpp
dict1.txt
DivTest.cpp [libFuzzer] use trace-div and trace-gep for guided fuzzing, add tests 2016-08-30 01:30:14 +00:00
DSO1.cpp [libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files. 2016-10-19 00:12:03 +00:00
DSO2.cpp [libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files. 2016-10-19 00:12:03 +00:00
DSOTestExtra.cpp [libFuzzer] change trace-pc to use 8-byte guards 2016-09-17 05:04:47 +00:00
DSOTestMain.cpp [libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files. 2016-10-19 00:12:03 +00:00
EmptyTest.cpp
FourIndependentBranchesTest.cpp
FullCoverageSetTest.cpp
fuzzer-customcrossover.test [libFuzzer] remove unused option 2016-09-30 22:29:57 +00:00
fuzzer-custommutator.test
fuzzer-dict.test
fuzzer-dirs.test [libFuzzer] refactoring: move the Corpus into a separate class; delete two unused experimental features 2016-09-21 01:04:43 +00:00
fuzzer-fdmask.test
fuzzer-finalstats.test
fuzzer-flags.test [libFuzzer] don't print help for internal flags 2016-09-10 00:35:30 +00:00
fuzzer-fn-adapter.test
fuzzer-jobs.test [libFuzzer] change trace-pc to use 8-byte guards 2016-09-17 05:04:47 +00:00
fuzzer-leak.test [libFuzzer] fix -error_exitcode=N, now with a test 2016-11-03 19:31:18 +00:00
fuzzer-oom-with-profile.test [libFuzzer] extend -rss_limit_mb to crash instantly on a single malloc that exceeds the limit 2016-11-30 22:39:35 +00:00
fuzzer-oom.test [libFuzzer] add a test for r288389 (-rss_limit_mb=0 means no limit). 2016-12-01 18:02:07 +00:00
fuzzer-printcovpcs.test [libFuzzer] test cleanup 2016-12-10 02:45:56 +00:00
fuzzer-runs.test
fuzzer-seed.test
fuzzer-segv.test
fuzzer-singleinputs.test [libFuzzer] fix a bug when running a single unit of N bytes with -max_len=M, M<N, caused a buffer overflow 2016-08-30 14:52:05 +00:00
fuzzer-threaded.test
fuzzer-timeout.test [libFuzzer] Fix bug in detecting timeouts when input string is empty. 2016-12-13 17:46:25 +00:00
fuzzer-traces-hooks.test
fuzzer-ubsan.test
fuzzer.test [libFuzzer] build libFuzzer itself with asan 2016-12-12 20:58:10 +00:00
FuzzerFnAdapterUnittest.cpp
FuzzerUnittest.cpp [libFuzzer] implement crash-resistant merge (https://github.com/google/sanitizers/issues/722). This is a first experimental variant that needs some more testing, thus not yet adding a lit test (but there are unit tests). 2016-12-09 01:17:24 +00:00
hi.txt
InitializeTest.cpp [libFuzzer] add StandaloneFuzzTargetMain.c and a test for it 2016-10-25 22:30:34 +00:00
LeakTest.cpp
LeakTimeoutTest.cpp
lit.cfg [libFuzzer] remove dfsan support and some related stale code. This is not being used and as is is pretty weak anyway 2016-10-04 06:08:46 +00:00
lit.site.cfg.in [libFuzzer] remove dfsan support and some related stale code. This is not being used and as is is pretty weak anyway 2016-10-04 06:08:46 +00:00
LoadTest.cpp [libFuzzer] use trace-div and trace-gep for guided fuzzing, add tests 2016-08-30 01:30:14 +00:00
MemcmpTest.cpp
merge.test [libFuzzer] respect -max_len during merge 2016-12-12 20:39:35 +00:00
minimize_crash.test [libFuzzer] don't require extra flags with -minimize_crash=1 (default to -max_total_time=600). Also respect exact_artifact_path when outputting the end result 2016-12-13 00:40:47 +00:00
NthRunCrashTest.cpp
NullDerefOnEmptyTest.cpp
NullDerefTest.cpp
OneHugeAllocTest.cpp
OutOfMemorySingleLargeMallocTest.cpp [libFuzzer] extend -rss_limit_mb to crash instantly on a single malloc that exceeds the limit 2016-11-30 22:39:35 +00:00
OutOfMemoryTest.cpp
repeated-bytes.test
RepeatedBytesTest.cpp
RepeatedMemcmp.cpp
shrink.test [libFuzzer] test cleanup 2016-12-10 02:45:56 +00:00
ShrinkControlFlowTest.cpp [libFuzzer] refactoring to make -shrink=1 work for value profile, added a test. 2016-10-05 22:56:21 +00:00
ShrinkValueProfileTest.cpp [libFuzzer] refactoring to make -shrink=1 work for value profile, added a test. 2016-10-05 22:56:21 +00:00
SignedIntOverflowTest.cpp
simple-cmp.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
SimpleCmpTest.cpp [libFuzzer] make SimpleCmpTest a bit simpler to crack and more verbose 2016-12-12 22:39:33 +00:00
SimpleDictionaryTest.cpp
SimpleFnAdapterTest.cpp
SimpleHashTest.cpp
SimpleTest.cpp
SimpleThreadedTest.cpp
SingleMemcmpTest.cpp
SingleStrcmpTest.cpp
SingleStrncmpTest.cpp
SpamyTest.cpp
standalone.test [libFuzzer] add StandaloneFuzzTargetMain.c and a test for it 2016-10-25 22:30:34 +00:00
StrcmpTest.cpp
StrncmpOOBTest.cpp [libFuzzer] add a test for asan's strict_string_checks=1 2016-10-22 00:05:44 +00:00
StrncmpTest.cpp
StrstrTest.cpp
swap-cmp.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
SwapCmpTest.cpp [libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test 2016-10-25 02:04:43 +00:00
Switch2Test.cpp [libFuzzer] add switch tests 2016-10-11 01:13:32 +00:00
SwitchTest.cpp
ThreadedLeakTest.cpp
ThreadedTest.cpp
TimeoutEmptyTest.cpp [libFuzzer] Fix bug in detecting timeouts when input string is empty. 2016-12-13 17:46:25 +00:00
TimeoutTest.cpp
trace-malloc.test [libFuzzer] add -trace_cmp=1 (guiding mutations based on the observed CMP instructions). This is a reincarnation of the previously deleted -use_traces, but using a different approach for collecting traces. Still a toy, but at least it scales well. Also fix -merge in trace-pc-guard mode 2016-10-14 20:20:33 +00:00
TraceMallocTest.cpp [libFuzzer] add -trace_malloc= flag 2016-10-13 19:06:46 +00:00
ulimit.test [libFuzzer] use less stack 2016-11-12 00:24:35 +00:00
UninstrumentedTest.cpp
value-profile-cmp2.test [libFuzzer] split one slow test into several, for more parallel testing 2016-12-12 22:55:25 +00:00
value-profile-cmp3.test [libFuzzer] split one slow test into several, for more parallel testing 2016-12-12 22:55:25 +00:00
value-profile-cmp4.test [libFuzzer] split one slow test into several, for more parallel testing 2016-12-12 22:55:25 +00:00
value-profile-cmp.test [libFuzzer] split one slow test into several, for more parallel testing 2016-12-12 22:55:25 +00:00
value-profile-div.test [libFuzzer] add -minimize_crash flag (to minimize crashers). also add two tests that I failed to commit last time 2016-09-01 01:22:27 +00:00
value-profile-load.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
value-profile-mem.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
value-profile-set.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
value-profile-strcmp.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
value-profile-strncmp.test [libFuzzer] enable use_cmp by default 2016-10-27 21:44:37 +00:00
value-profile-switch.test [libFuzzer] test cleanup 2016-12-10 02:45:56 +00:00