forked from OSchip/llvm-project
parent
924978bb43
commit
9d0f02af3d
|
@ -239,15 +239,21 @@ void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args,
|
|||
// Execute the inner process untill it passes.
|
||||
// Every inner process should execute at least one input.
|
||||
std::string BaseCmd = CloneArgsWithoutX(Args, "keep-all-flags");
|
||||
bool Success = false;
|
||||
for (size_t i = 1; i <= AllFiles.size(); i++) {
|
||||
Printf("MERGE-OUTER: attempt %zd\n", i);
|
||||
auto ExitCode =
|
||||
ExecuteCommand(BaseCmd + " -merge_control_file=" + CFPath);
|
||||
if (!ExitCode) {
|
||||
Printf("MERGE-OUTER: succesfull in %zd attempt(s)\n", i);
|
||||
Success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!Success) {
|
||||
Printf("MERGE-OUTER: zero succesfull attempts, exiting\n");
|
||||
exit(1);
|
||||
}
|
||||
// Read the control file and do the merge.
|
||||
Merger M;
|
||||
std::ifstream IF(CFPath);
|
||||
|
|
|
@ -52,3 +52,7 @@ TMPDIR: MERGE-OUTER: failed to write to the control file: DIR_DOES_NOT_EXIST/lib
|
|||
# Check that we can report an error if file size exceeded
|
||||
RUN: (ulimit -f 1; not LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ)
|
||||
SIGXFSZ: ERROR: libFuzzer: file size exceeded
|
||||
|
||||
RUN: rm -rf %tmp/T1/* %tmp/T2/*
|
||||
RUN: not LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=EMPTY
|
||||
EMPTY: MERGE-OUTER: zero succesfull attempts, exiting
|
||||
|
|
Loading…
Reference in New Issue