[PATCH] D29546: [libFuzzer] Improve fuzzer-jobs test for Posix.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 15:22:06 PST 2017


delcypher added a comment.

In https://reviews.llvm.org/D29546#668166, @mpividori wrote:

> @kcc Also, if we are not going to check if the process is still running after 2 seconds, it doesn't make sense to run it in background. We could just run it normally and remove the while loop that waits for the process to finish.


@mpividori There is a very good reason for running the test in the background. You should read the commit message where this test was introduced (r278544). It exists to check for a bug that used to exist in LibFuzzer on macOS where workers
would not actually run in parallel and instead would run sequentially. This tries to test for this bad behaviour by starting a run of libFuzzer and while it is running checking that more than one log file exists (in the older buggy version of libfuzzer on macOS only `fuzz-0.log` would exist in the
initial 4 second window and then after that `fuzz-1.log` would be created).

This of course means this test is racey (We are hoping that all worker processes have been started within approximately two seconds). I'm not very happy with this test due to its racey behaviour it but I couldn't come up with a better way to test it from lit because it requires observing what `LLVMFuzzer-EmptyTest` is doing **while** it is running (rather than checking it's output afterwards which is how we normally write lit tests).

I will happily review a replacement (or even removal) of this test but I don't think your changes improves how things are currently.


https://reviews.llvm.org/D29546





More information about the llvm-commits mailing list