summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerFork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerFork.cpp')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerFork.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerFork.cpp b/compiler-rt/lib/fuzzer/FuzzerFork.cpp
index 1f7fe9b3372..52a233f05ed 100644
--- a/compiler-rt/lib/fuzzer/FuzzerFork.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerFork.cpp
@@ -304,13 +304,13 @@ void FuzzWithFork(Random &Rand, const FuzzingOptions &Options,
}
Stop = true;
- // The workers have already finished doing useful work, or
- // we were interrupted. Either way, cleanup up now.
- RmDirRecursive(Env.TempDir);
-
for (auto &T : Threads)
T.join();
+ // The workers have terminated. Don't try to remove the directory before they
+ // terminate to avoid a race condition preventing cleanup on Windows.
+ RmDirRecursive(Env.TempDir);
+
// Use the exit code from the last child process.
Printf("INFO: exiting: %d time: %zds\n", ExitCode,
Env.secondsSinceProcessStartUp());
@@ -318,4 +318,3 @@ void FuzzWithFork(Random &Rand, const FuzzingOptions &Options,
}
} // namespace fuzzer
-
OpenPOWER on IntegriCloud