facebookincubator/velox

Bug in between(ipprefix, ipprefix, ipprefix)

Opened this issue · 1 comments

Description

Expression fuzzer found a result mismatch between the common eval and simplified eval in between(ipprefix, ipprefix, ipprefix). The mismatch is due to a bug in RowView::compareImpl() where index into DecodedVector is used with the DecodedVector's base vector.

->baseVector()
->compare(
std::get<Is>(*other.childReaders_)->baseVector(),
offset_,
other.offset_,
flags);

Error Reproduction

Run the following command on top of #11846.

velox_expression_fuzzer_test
--enable_variadic_signatures
--velox_fuzzer_enable_complex_types
--lazy_vector_generation_ratio
0.2
--common_dictionary_wraps_generation_ratio=0.3
--velox_fuzzer_enable_column_reuse
--velox_fuzzer_enable_expression_reuse
--max_expression_trees_per_step
2
--retry_with_try
--enable_dereference
--duration_sec
1800
--logtostderr=1
--minloglevel=0
--seed=3877512733

Relevant logs

I20241216 10:09:51.674111 977155 ExpressionFuzzerVerifier.cpp:356] ==============================> Started iteration 0 (seed: 3877512733)
I20241216 10:09:51.674897 977155 ExpressionVerifier.cpp:104] Executing expression 0 : xxhash64(to_utf8(UM_@$-\1Zr[--?c2-*I7x[5P*H=Sqo04!@e''K1@0Tu70]))
I20241216 10:09:51.674919 977155 ExpressionVerifier.cpp:104] Executing expression 1 : between({115133623105189926705148207074365242575, [0->0] 118},"c0",{129013129174304261811603096449703045709, [11->10] [10->15] 103})
I20241216 10:09:51.674968 977155 ExpressionVerifier.cpp:104] Executing expression 2 : "row_number"
I20241216 10:09:51.676100 977155 FuzzerToolkit.cpp:158] Two vectors match.
I20241216 10:09:51.676937 977155 FuzzerToolkit.cpp:158] Two vectors match.
I20241216 10:09:51.677024 977155 FuzzerToolkit.cpp:158] Two vectors match.
E20241216 10:09:51.677047 977155 Exceptions.h:66] Line: /Users/weihe/Development/velox/velox/expression/fuzzer/FuzzerToolkit.cpp:155, Function:operator(), Expression: left->equalValueAt(right.get(), row, row) Different values at idx '2': '[2->87] true' vs. 'false', Source: RUNTIME, ErrorCode: INVALID_STATE
I20241216 10:09:51.677120 977155 ExpressionVerifier.cpp:411] Skipping persistence because repro path is empty.
libc++abi: terminating due to uncaught exception of type facebook::velox::VeloxRuntimeError: Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Reason: Different values at idx '2': '[2->87] true' vs. 'false'
Retriable: False
Expression: left->equalValueAt(right.get(), row, row)
Function: operator()
File: /Users/weihe/Development/velox/velox/expression/fuzzer/FuzzerToolkit.cpp
Line: 155