Skip to content

Commit 4a966b2

Browse files
pratikpugaliameta-codesync[bot]
authored andcommitted
Fix: SIGSEGV in AggregationFuzzer when reference query returns empty result vector (facebookincubator#17018)
Summary: Pull Request resolved: facebookincubator#17018 `compareEquivalentPlanResults` calls `mergeRowVectors` on the reference query result without checking if the result vector is empty. When the reference query runner (e.g. SparkQueryRunner) returns a valid `optional` containing an empty `vector<RowVectorPtr>` (query succeeded but produced zero result batches), `mergeRowVectors` crashes accessing `results[0]` on an empty vector. This was the root cause of recurring Spark Aggregate Fuzzer SIGSEGV crashes in the scheduled CI (e.g. seed 13256, iteration 6). The fix adds an emptiness check on the result vector before calling `mergeRowVectors`. Reviewed By: kgpai Differential Revision: D99347601 fbshipit-source-id: 9deff0630f7f8e124ffa0a98c9a8b89102fc8acb
1 parent 4bbea83 commit 4a966b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

velox/exec/fuzzer/AggregationFuzzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ bool AggregationFuzzer::compareEquivalentPlanResults(
10791079
firstPlan, referenceQueryRunner_.get());
10801080
stats_.updateReferenceQueryStats(referenceResult.second);
10811081

1082-
if (referenceResult.first) {
1082+
if (referenceResult.first && !referenceResult.first.value().empty()) {
10831083
velox::fuzzer::ResultOrError expected;
10841084
expected.result = fuzzer::mergeRowVectors(
10851085
referenceResult.first.value(), pool_.get());

0 commit comments

Comments
 (0)