[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:05:32 PST 2017


delcypher added a comment.

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

> @kcc No. It doesn't run until killed. It runs until timeout.


That's what @kcc said no?

> ` kill -0 ${FUZZER_PID};` only checks if the process if running and waits until it finishes with the while loop. But the condition could be false the first time you check. I mean, you are not checking if the process is still running after 2 seconds, you are only waiting.
>  Because of that, I modified the test to:
> 
> - First check if the process is running: ``` kill -0 ${FUZZER_PID} ``` This retuns non-zero value if the process is not running.

Your description of what `kill -O ${FUZZER_PID}` is right but I think your change is wrong. If any `RUN:` lines fail then the test as a whole test will fail. That's how lit shell tests work. This means your change to the test will non-deterministically fail depending on when `LLVMFuzzer-EmptyTest` exits. We don't want that.

> - Second, wait for the process to finish: ``` wait ${FUZZER_PID} ``` Instead of the while loop.

I didn't know about this shell built-in but again this change doesn't seem right to me. If `wait` is given a PID that has already finished then it will return a non-zero exit code and the test will fail. We don't want this.


https://reviews.llvm.org/D29546





More information about the llvm-commits mailing list