Skip to content

Commit

Permalink
fix: Avoid running the fuzzer if there are no functions to fuzz
Browse files Browse the repository at this point in the history
Summary:
There are edge cases when the input to the fuzzer results in no signatures to fuzz due to combination of skipped functions and skipped input types. This causes the fuzzer to fail when it tries to generate an expression, specifically failing in `ExpressionFuzzer::fuzzReturnType()`, at VELOX_CHECK(!signatures_.empty(), "No function signature available.");. 

Instead of failing the fuzzer at fuzzing time, let's exit the fuzzer with a warning that there were no functions to even fuzz.

Differential Revision: D67153128
  • Loading branch information
yuandagits authored and facebook-github-bot committed Dec 22, 2024
1 parent e9bb6c1 commit 02a3349
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions velox/expression/fuzzer/ExpressionFuzzerVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ void ExpressionFuzzerVerifier::go() {
0,
"--max_expression_trees_per_step needs to be greater than zero.");

if (expressionFuzzer_.supportedFunctions().empty()) {
LOG(WARNING) << "No functions to fuzz.";
return;
}

auto startTime = std::chrono::system_clock::now();
size_t i = 0;
size_t numFailed = 0;
Expand Down

0 comments on commit 02a3349

Please sign in to comment.