velox icon indicating copy to clipboard operation
velox copied to clipboard

Unmatched error code: UNSUPPORTED (User) vs. INVALID_STATE (Runtime)

Open kagamiori opened this issue 3 years ago • 1 comments
trafficstars

======> Started iteration 0 (seed: 2374890561)
I1008 09:10:12.972766 1057860 ExpressionFuzzer.cpp:798] Executing expression: array_position(map_keys(map(10 elements starting at 460 {0.4678218960762024, 0.47812965512275696, 0.6693397164344788, 0.8464414477348328, 0.47420749068260193, ...},"c0")),clamp(subscript("c1",true),array_min("c2"),0.8972604870796204))
I1008 09:10:12.973145 1057860 ExpressionFuzzer.cpp:801] 3 vectors as input:
I1008 09:10:12.973186 1057860 ExpressionFuzzer.cpp:803] 	[ARRAY ARRAY<TIMESTAMP>: 100 elements, 12 nulls]
I1008 09:10:12.973263 1057860 ExpressionFuzzer.cpp:803] 	[DICTIONARY MAP<BOOLEAN,REAL>: 100 elements, 5 nulls], [CONSTANT MAP<BOOLEAN,REAL>: 100 elements, 10 elements starting at 60 {[60->139] [139->29] null => 0.8354929685592651, [61->99] [99->25] 0 => 0.7618759870529175, [62->90] [90->185] 0 => 0.38347578048706055, [63->46] [46->49] 1 => 0.5201836228370667, [64->114] [114->2] 1 => 0.19199559092521667, ...}], [MAP MAP<BOOLEAN,REAL>: 20 elements, 1 nulls]
I1008 09:10:12.973493 1057860 ExpressionFuzzer.cpp:803] 	[ARRAY ARRAY<REAL>: 100 elements, 9 nulls]
E1008 09:10:12.984797 1057860 Exceptions.h:68] Line: buck-out/dev/gen/aab7ed39/velox/functions/lib/velox_functions_lib#header-mode-symlink-tree-with-header-map,headers/velox/functions/lib/SubscriptUtil.h:144, Function:applyMap, Expression:  Unsupported map key type for element_at: BOOLEAN, Source: USER, ErrorCode: UNSUPPORTED
E1008 09:10:12.994654 1057860 Exceptions.h:68] Line: buck-out/dev/gen/aab7ed39/velox/vector/velox_vector#header-mode-symlink-tree-with-header-map,headers/velox/vector/DictionaryVector-inl.h:50, Function:setInternalState, Expression: rawIndices_[i] < dictionaryValues_->size() (889 vs. 880) Dictionary index must be less than base vector's size. Index: 880., Source: RUNTIME, ErrorCode: INVALID_STATE
E1008 09:10:12.996033 1057860 Exceptions.h:68] Line: velox/expression/tests/ExpressionFuzzer.cpp:109, Function:compareExceptions, Expression: ve1.errorCode() == ve2.errorCode() || (ve1.errorCode() == "INVALID_ARGUMENT" && ve2.errorCode() == "UNSUPPORTED") || (ve2.errorCode() == "INVALID_ARGUMENT" && ve1.errorCode() == "UNSUPPORTED") , Source: RUNTIME, ErrorCode: INVALID_STATE
terminate called after throwing an instance of 'facebook::velox::VeloxRuntimeError'
  what():  Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Retriable: False
Expression: ve1.errorCode() == ve2.errorCode() || (ve1.errorCode() == "INVALID_ARGUMENT" && ve2.errorCode() == "UNSUPPORTED") || (ve2.errorCode() == "INVALID_ARGUMENT" && ve1.errorCode() == "UNSUPPORTED")
Function: compareExceptions
File: velox/expression/tests/ExpressionFuzzer.cpp
Line: 109
Stack trace:
...

kagamiori avatar Oct 08 '22 16:10 kagamiori

The previously attached files cannot reproduce the exact same error. Below is another similar error. This error can only be reproduced internally due to https://github.com/facebookincubator/velox/issues/2972. To reproduce it, check out 078ffeddc in the internal repository and then run buck-out/gen/velox/expression/tests/velox_expression_fuzzer_test --velox_fuzzer_enable_complex_types --velox_fuzzer_max_level_of_nesting 3 --only "array_position,map_keys,clamp,map,subscript,array_min" --seed 3866408068.

======> Started iteration 0 (seed: 3866408068)
I1026 14:51:57.391597 3236793 ExpressionVerifier.cpp:130] Executing expression: subscript(map(10 elements starting at 360 {[360->697] 0.815247118473053, [361->789] 0.5434132218360901, [362->61] 0.7945303320884705, [363->448] 0.48778656125068665, [364->494] 0.8281741738319397, ...},map_keys("c0")),"c1")
I1026 14:51:57.391942 3236793 ExpressionVerifier.cpp:133] 2 vectors as input:
I1026 14:51:57.392011 3236793 ExpressionVerifier.cpp:135] 	[DICTIONARY MAP<TINYINT,SMALLINT>: 100 elements, 8 nulls], [DICTIONARY MAP<TINYINT,SMALLINT>: 100 elements, 8 nulls], [MAP MAP<TINYINT,SMALLINT>: 100 elements, 9 nulls]
I1026 14:51:57.392110 3236793 ExpressionVerifier.cpp:135] 	[DICTIONARY REAL: 100 elements, 12 nulls], [FLAT REAL: 100 elements, 11 nulls]
E1026 14:51:57.402151 3236793 Exceptions.h:68] Line: buck-out/dev/gen/aab7ed39/velox/functions/lib/velox_functions_lib#header-mode-symlink-tree-with-header-map,headers/velox/functions/lib/SubscriptUtil.h:144, Function:applyMap, Expression:  Unsupported map key type for element_at: REAL, Source: USER, ErrorCode: UNSUPPORTED
E1026 14:51:57.410769 3236793 Exceptions.h:68] Line: buck-out/dev/gen/aab7ed39/velox/vector/velox_vector#header-mode-symlink-tree-with-header-map,headers/velox/vector/DictionaryVector-inl.h:50, Function:setInternalState, Expression: rawIndices_[i] < dictionaryValues_->size() (825 vs. 820) Dictionary index must be less than base vector's size. Index: 820., Source: RUNTIME, ErrorCode: INVALID_STATE
E1026 14:51:57.412091 3236793 Exceptions.h:68] Line: velox/expression/tests/ExpressionVerifier.cpp:49, Function:compareExceptions, Expression: left.errorCode() == right.errorCode() || (left.errorCode() == "INVALID_ARGUMENT" && right.errorCode() == "UNSUPPORTED") || (right.errorCode() == "INVALID_ARGUMENT" && left.errorCode() == "UNSUPPORTED") , Source: RUNTIME, ErrorCode: INVALID_STATE
I1026 14:51:57.413509 3236793 ExpressionVerifier.cpp:288] Persisted input at '/home/weihe/fuzzer_repro/velox_vector_1nhHAZ' and result at '/home/weihe/fuzzer_repro/velox_vector_8gUwCM' and sql at '/home/weihe/fuzzer_repro/velox_sql_F4F7F9'
terminate called after throwing an instance of 'facebook::velox::VeloxRuntimeError'
  what():  Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Retriable: False
Expression: left.errorCode() == right.errorCode() || (left.errorCode() == "INVALID_ARGUMENT" && right.errorCode() == "UNSUPPORTED") || (right.errorCode() == "INVALID_ARGUMENT" && left.errorCode() == "UNSUPPORTED")
Function: compareExceptions
File: velox/expression/tests/ExpressionVerifier.cpp
Line: 49
Stack trace:
# 0  std::shared_ptr<facebook::velox::VeloxException::State const> facebook::velox::VeloxException::State::make<facebook::velox::VeloxException::make(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)::$_0>(facebook::velox::VeloxException::Type, facebook::velox::VeloxException::make(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)::$_0)
# 1  facebook::velox::VeloxException::VeloxException(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)
# 2  facebook::velox::VeloxRuntimeError::VeloxRuntimeError(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, std::basic_string_view<char, std::char_traits<char> >)
# 3  void facebook::velox::detail::veloxCheckFail<facebook::velox::VeloxRuntimeError, facebook::velox::detail::CompileTimeEmptyString>(facebook::velox::detail::VeloxCheckFailArgs const&, facebook::velox::detail::CompileTimeEmptyString)
# 4  facebook::velox::test::(anonymous namespace)::compareExceptions(facebook::velox::VeloxException const&, facebook::velox::VeloxException const&)
# 5  facebook::velox::test::(anonymous namespace)::compareExceptions(std::__exception_ptr::exception_ptr, std::__exception_ptr::exception_ptr)
# 6  facebook::velox::test::ExpressionVerifier::verify(std::shared_ptr<facebook::velox::core::ITypedExpr const> const&, std::shared_ptr<facebook::velox::RowVector> const&, std::shared_ptr<facebook::velox::BaseVector>&&, bool)
# 7  facebook::velox::test::ExpressionFuzzer::go()
# 8  facebook::velox::test::expressionFuzzer(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<facebook::velox::exec::FunctionSignature const*, std::allocator<facebook::velox::exec::FunctionSignature const*> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<facebook::velox::exec::FunctionSignature const*, std::allocator<facebook::velox::exec::FunctionSignature const*> > > > >, unsigned long)
# 9  FuzzerRunner::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, std::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)
# 10 main
# 11 __libc_start_call_main
# 12 __libc_start_main_alias_2
# 13 _start

*** Aborted at 1666821117 (Unix time, try 'date -d @1666821117') ***
*** Signal 6 (SIGABRT) (0x37b3c003163b9) received by PID 3236793 (pthread TID 0x7f5bffbdaec0) (linux TID 3236793) (maybe from PID 3236793, UID 228156) (code: -6), stack trace: ***
    @ 0000000000010fee folly::symbolizer::(anonymous namespace)::innerSignalHandler(int, siginfo_t*, void*)
                       ./folly/experimental/symbolizer/SignalHandler.cpp:449
    @ 000000000000f711 folly::symbolizer::(anonymous namespace)::signalHandler(int, siginfo_t*, void*)
                       ./folly/experimental/symbolizer/SignalHandler.cpp:470
    @ 0000000000000000 (unknown)
    @ 000000000009c9d3 __GI___pthread_kill
    @ 00000000000444ec __GI_raise
    @ 000000000002c432 __GI_abort
    @ 00000000000a3fd4 __gnu_cxx::__verbose_terminate_handler()
    @ 00000000000a1b39 __cxxabiv1::__terminate(void (*)())
    @ 00000000000a1ba4 std::terminate()
    @ 00000000000a1ec1 __cxa_rethrow
    @ 000000000001ec9c facebook::velox::test::ExpressionVerifier::verify(std::shared_ptr<facebook::velox::core::ITypedExpr const> const&, std::shared_ptr<facebook::velox::RowVector> const&, std::shared_ptr<facebook::velox::BaseVector>&&, bool)
                       ./velox/expression/tests/ExpressionVerifier.cpp:227
    @ 0000000000095986 facebook::velox::test::ExpressionFuzzer::go()
                       ./velox/expression/tests/ExpressionFuzzer.cpp:727
    @ 00000000000d8cfd facebook::velox::test::expressionFuzzer(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<facebook::velox::exec::FunctionSignature const*, std::allocator<facebook::velox::exec::FunctionSignature const*> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<facebook::velox::exec::FunctionSignature const*, std::allocator<facebook::velox::exec::FunctionSignature const*> > > > >, unsigned long)
                       ./velox/expression/tests/ExpressionFuzzer.cpp:754
    @ 00000000002c30e3 FuzzerRunner::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, std::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)
                       ./velox/expression/tests/FuzzerRunner.h:108
                       -> ./velox/expression/tests/ExpressionFuzzerTest.cpp
    @ 00000000002c29ac main
                       ./velox/expression/tests/ExpressionFuzzerTest.cpp:57
    @ 000000000002c656 __libc_start_call_main
    @ 000000000002c717 __libc_start_main_alias_2
    @ 00000000002b8b80 _start
                       /home/engshare/third-party2/glibc/2.34/src/glibc-2.34/csu/../sysdeps/x86_64/start.S:116
Aborted (core dumped)

kagamiori avatar Oct 26 '22 21:10 kagamiori

This error may be the same as https://github.com/facebookincubator/velox/issues/2971.

kagamiori avatar Oct 26 '22 21:10 kagamiori

Fixed in https://github.com/facebookincubator/velox/issues/2789

pedroerp avatar Oct 27 '22 15:10 pedroerp