velox: contains(), subscript(), array_position() fail with Index is too large

Bug description

Found by running Fuzzer (#6312) with “–only contains”

I20230830 06:53:52.203747 4859347 ExpressionFuzzer.cpp:1313] ==============================> Started iteration 6 (seed: 3597353198)
I20230830 06:53:52.411063 4859347 ExpressionVerifier.cpp:86] Executing expression 0 : contains("c0"["row_field1"],"c1"["row_field0"]["row_field2"]["row_field0"])
I20230830 06:53:52.411126 4859347 ExpressionVerifier.cpp:86] Executing expression 1 : contains("c0"["row_field1"],"c1"["row_field0"]["row_field2"]["row_field0"])
E20230830 06:53:52.416990 4859347 Exceptions.h:69] Line: /Users/mbasmanova/cpp/velox-1/./velox/vector/BaseVector.h:145, Function:isNullAt, Expression: idx < length_ (94 vs. 94) Index is too large, Source: RUNTIME, ErrorCode: INVALID_STATE
E20230830 06:53:52.417413 4859347 ExpressionVerifier.cpp:176] Common eval: Exceptions other than VeloxUserError are not allowed.
I20230830 06:53:52.417447 4859347 ExpressionVerifier.cpp:252] 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: (94 vs. 94) Index is too large
Retriable: False
Expression: idx < length_
Context: contains((c0).row_field1, (((c1).row_field0).row_field2).row_field0)
Top-Level Context: Same as context.
Function: isNullAt
File: /Users/mbasmanova/cpp/velox-1/./velox/vector/BaseVector.h
Line: 145

System information

n/a

Relevant logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

These issues are important to fix as they may cause a query to succeed, but produce incorrect results.

@mbasmanova Got it, I can take this one too.