Please check the issue list for the same bug
- [X] I have checked issue list and this bug is encountered for the first time.
Environment
- OceanBase 3.1.4 (r1-e8452fc9476833d40576e73fe208f579d3c06655)
- Ubuntu 18.04
- obclient Ver 15.1 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1
Fast Reproduce Steps(Required)
This following SQL query caused observer crash.
CREATE TABLE v81754 ( v81755 INT , v81756 CHAR ) ; CREATE VIEW v81757 AS SELECT v81756 , ( SELECT v81755 FROM ( WITH v81763 AS ( WITH v81761 AS ( SELECT v81755 FROM ( WITH v81759 AS ( SELECT v81756 FROM ( SELECT NOT v81755 <= 'x' , v81756 FROM v81754 GROUP BY v81756 ) AS v81758 ) SELECT DISTINCT v81756 , ( v81756 = 38 OR v81756 > 'x' ) FROM v81759 ) AS v81760 NATURAL JOIN v81754 ) SELECT v81755 FROM ( SELECT NOT v81755 <= 'x' , v81755 FROM v81754 GROUP BY v81755 ) AS v81762 ) SELECT DISTINCT v81755 , ( v81756 = 26 OR v81755 > 'x' ) FROM v81754 ) AS v81764 NATURAL JOIN v81754 WHERE v81755 = v81756 ) AS v81765 FROM v81754 ;
Actual Behavior
observer crashed in debug version
Expected Behavior
No response
other information
#0 __GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007fe764c3c7f1 in __GI_abort () at abort.c:79
#2 0x00007fe764c2c3fa in __assert_fail_base (fmt=0x7fe64d11de50 "%s%s%s:%u:%s%s?? '%s' ???\n%n", [email protected]=0x317345 "v", [email protected]=0x3bc677 "/oceanbase_fuzz/oceanbase/deps/oblib/src/lib/container/ob_array_wrap.h", [email protected]=41, [email protected]=0x8ceb08 "const T &oceanbase::common::ObIArrayWrap<oceanbase::sql::TableItem *>::at(int64_t) const [T = oceanbase::sql::TableItem *]") at assert.c:92
#3 0x00007fe764c2c472 in __GI___assert_fail (assertion=0x317345 "v", file=0x3bc677 "/oceanbase_fuzz/oceanbase/deps/oblib/src/lib/container/ob_array_wrap.h", line=41, function=0x8ceb08 "const T &oceanbase::common::ObIArrayWrap<oceanbase::sql::TableItem *>::at(int64_t) const [T = oceanbase::sql::TableItem *]") at assert.c:101
#4 0x00000000048a3b73 in oceanbase::common::ObIArrayWrapoceanbase::sql::TableItem*::at (this= 0x7fe6bff162d0, idx=0) at ./deps/oblib/src/lib/container/ob_array_wrap.h:41
#5 0x00000000066500e5 in oceanbase::sql::ObSelectStmtPrinter::print_with (this=0x7fe67da34848) at ./src/sql/ob_select_stmt_printer.cpp:835
#6 0x000000000664f8cc in oceanbase::sql::ObSelectStmtPrinter::print (this=0x7fe67da34848) at ./src/sql/ob_select_stmt_printer.cpp:83
#7 0x0000000006607579 in oceanbase::sql::ObSelectStmtPrinter::do_print (this=0x7fe67da34848) at ./src/sql/ob_select_stmt_printer.cpp:58
#8 0x0000000006603730 in oceanbase::sql::ObDMLStmtPrinter::print_table (this=0x7fe67da357e8, table_item=0x7fe6bfe32250, expand_cte_table=true, no_print_alias=false) at ./src/sql/ob_dml_stmt_printer.cpp:477
#9 0x0000000006650356 in oceanbase::sql::ObSelectStmtPrinter::print_with (this=0x7fe67da357e8) at ./src/sql/ob_select_stmt_printer.cpp:846
#10 0x000000000664f8cc in oceanbase::sql::ObSelectStmtPrinter::print (this=0x7fe67da357e8) at ./src/sql/ob_select_stmt_printer.cpp:83
#11 0x0000000006607579 in oceanbase::sql::ObSelectStmtPrinter::do_print (this=0x7fe67da357e8) at ./src/sql/ob_select_stmt_printer.cpp:58
#12 0x0000000006603730 in oceanbase::sql::ObDMLStmtPrinter::print_table (this=0x7fe67da36e98, table_item=0x7fe6bfe372b0, expand_cte_table=false, no_print_alias=false) at ./src/sql/ob_dml_stmt_printer.cpp:477
#13 0x0000000006600b13 in oceanbase::sql::ObDMLStmtPrinter::print_table (this=0x7fe67da36e98, table_item=0x7fe6bfe275b0, expand_cte_table=false, no_print_alias=false) at ./src/sql/ob_dml_stmt_printer.cpp:367
#14 0x00000000065f5fae in oceanbase::sql::ObDMLStmtPrinter::print_from (this=0x7fe67da36e98, need_from=true) at ./src/sql/ob_dml_stmt_printer.cpp:302
#15 0x000000000665215c in oceanbase::sql::ObSelectStmtPrinter::print_basic_stmt (this=0x7fe67da36e98) at ./src/sql/ob_select_stmt_printer.cpp:318
#16 0x000000000664fa94 in oceanbase::sql::ObSelectStmtPrinter::print (this=0x7fe67da36e98) at ./src/sql/ob_select_stmt_printer.cpp:93
#17 0x0000000006607579 in oceanbase::sql::ObSelectStmtPrinter::do_print (this=0x7fe67da36e98) at ./src/sql/ob_select_stmt_printer.cpp:58
---Type to continue, or q to quit---
#18 0x0000000006384839 in oceanbase::sql::ObRawExprPrinter::print (this=0x7fe67da37f18, expr=0x7fe6bfed1cd0) at ./src/sql/resolver/expr/ob_raw_expr_printer.cpp:242
#19 0x0000000006381ecd in oceanbase::sql::ObRawExprPrinter::print (this=0x7fe67da37f18, expr=0x7fe6bfed1cd0) at ./src/sql/resolver/expr/ob_raw_expr_printer.cpp:108
#20 0x0000000006381524 in oceanbase::sql::ObRawExprPrinter::do_print (this=0x7fe67da37f18, expr=0x7fe6bfed1cd0, scope=oceanbase::sql::T_FIELD_LIST_SCOPE, only_column_namespace=false) at ./src/sql/resolver/expr/ob_raw_expr_printer.cpp:72
#21 0x0000000006653950 in oceanbase::sql::ObSelectStmtPrinter::print_select (this=0x7fe67da37ee0) at ./src/sql/ob_select_stmt_printer.cpp:404
#22 0x000000000665206f in oceanbase::sql::ObSelectStmtPrinter::print_basic_stmt (this=0x7fe67da37ee0) at ./src/sql/ob_select_stmt_printer.cpp:316
#23 0x000000000664fa94 in oceanbase::sql::ObSelectStmtPrinter::print (this=0x7fe67da37ee0) at ./src/sql/ob_select_stmt_printer.cpp:93
#24 0x0000000006607579 in oceanbase::sql::ObSelectStmtPrinter::do_print (this=0x7fe67da37ee0) at ./src/sql/ob_select_stmt_printer.cpp:58
#25 0x0000000006c72f50 in oceanbase::sql::ObCreateViewResolver::stmt_print (this=0x7fe5e5299d30, stmt=0x7fe6bfe58d50, column_list=0x0, expanded_view=...) at ./src/sql/resolver/ddl/ob_create_view_resolver.cpp:528
#26 0x0000000006c701fd in oceanbase::sql::ObCreateViewResolver::resolve (this=0x7fe5e5299d30, parse_tree=...) at ./src/sql/resolver/ddl/ob_create_view_resolver.cpp:396
#27 0x0000000005ba5488 in oceanbase::sql::ObResolver::stmt_resolver_funcoceanbase::sql::ObCreateViewResolver (this=0x7fe67da3be28, params=..., parse_tree=..., [email protected]: 0x0) at ./src/sql/resolver/ob_resolver.cpp:125
#28 0x0000000005b3d5bf in oceanbase::sql::ObResolver::resolve (this=0x7fe67da3be28, if_prepared=oceanbase::sql::ObResolver::IS_NOT_PREPARED_STMT, parse_tree=..., [email protected]: 0x0) at ./src/sql/resolver/ob_resolver.cpp:238
#29 0x000000000666e7ca in oceanbase::sql::ObSql::generate_stmt (this=0xbddc740 oceanbase::observer::ObServer::get_instance()::THE_ONE+1111488, parse_result=..., pc_ctx=0x7fe5e5289960, context=..., allocator=..., result=..., [email protected]: 0x0) at ./src/sql/ob_sql.cpp:1406
#30 0x000000000667352e in oceanbase::sql::ObSql::generate_physical_plan (this=0xbddc740 oceanbase::observer::ObServer::get_instance()::THE_ONE+1111488, parse_result=..., pc_ctx=0x7fe5e5289960, sql_ctx=..., result=..., is_ps_mode=false) at ./src/sql/ob_sql.cpp:1527
#31 0x00000000066718d5 in oceanbase::sql::ObSql::handle_physical_plan (this=0xbddc740 oceanbase::observer::ObServer::get_instance()::THE_ONE+1111488, trimed_stmt=..., context=..., result=..., pc_ctx=..., get_plan_err=-5138) at ./src/sql/ob_sql.cpp:3224
#32 0x00000000066f6ee4 in oceanbase::sql::ObSql::handle_text_query (this=0xbddc740 oceanbase::observer::ObServer::get_instance()::THE_ONE+1111488, stmt=..., context=..., result=...) at ./src/sql/ob_sql.cpp:1205
#33 0x00000000066641e1 in oceanbase::sql::ObSql::stmt_query (this=0xbddc740 oceanbase::observer::ObServer::get_instance()::THE_ONE+1111488, stmt=..., context=..., result=...) at ./src/sql/ob_sql.cpp:169
#34 0x000000000ad2940d in oceanbase::observer::ObMPQuery::do_process (this=0x7fe5e52774d0, session=..., has_more_result=false, force_sync_resp=false, [email protected]: false, [email protected]: true) at ./src/observer/mysql/obmp_query.cpp:628
#35 oceanbase::observer::ObMPQuery::process_single_stmt (this=0x7fe5e52774d0, multi_stmt_item=..., session=..., has_more_result=false, force_sync_resp=false, [email protected]: false, [email protected]: true) at ./src/observer/mysql/obmp_query.cpp:431
#36 0x000000000ad25bab in oceanbase::observer::ObMPQuery::process (this=0x7fe5e52774d0) at ./src/observer/mysql/obmp_query.cpp:248
#37 0x000000000b6c24ad in oceanbase::rpc::frame::ObReqProcessor::run (this=0x7fe5e52774d0) at ./deps/oblib/src/rpc/frame/ob_req_processor.cpp:50
#38 0x000000000aa86880 in oceanbase::omt::ObWorkerProcessor::process_one (this=0xc647b00 oceanbase::observer::ObServer::get_instance()::THE_ONE+9939328, req=..., [email protected]: 0) at ./src/observer/omt/ob_worker_processor.cpp:64
#39 0x000000000aa6342a in oceanbase::omt::ObWorkerProcessor::process (this=0xc647b00 oceanbase::observer::ObServer::get_instance()::THE_ONE+9939328, req=...) at ./src/observer/omt/ob_worker_processor.cpp:125
#40 0x000000000aa84636 in oceanbase::omt::ObThWorker::process_request (this=0x7fe6bc6b3dd0, req=...) at ./src/observer/omt/ob_th_worker.cpp:286
#41 0x000000000aa6134f in oceanbase::omt::ObThWorker::worker (this=0x7fe6bc6b3dd0, [email protected]: 1, [email protected]: 1657802052890209, [email protected]: 0) at ./src/observer/omt/ob_th_worker.cpp:450
#42 0x000000000aa6181c in oceanbase::omt::ObThWorker::run (this=0x7fe6bc6b3dd0, idx=0) at ./src/observer/omt/ob_th_worker.cpp:486
#43 0x0000000002961e1c in oceanbase::lib::CoKThreadTemp<oceanbase::lib::CoUserThreadTempoceanbase::lib::CoSetSched >::start()::{lambda()#1}::operator()() const ( this=0x7fe692772808) at ./deps/oblib/src/lib/coro/co_user_thread.h:295
#44 0x0000000002961cad in std::_Function_handler<void (), oceanbase::lib::CoKThreadTemp<oceanbase::lib::CoUserThreadTempoceanbase::lib::CoSetSched >::start()::{lambd---Type to continue, or q to quit---
a()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at ./deps/3rd/usr/local/oceanbase/devtools/lib/gcc/x86_64-redhat-linux/5.2.0/../../../../include/c++/5.2.0/functional:1871
#45 0x0000000001ee4d3e in std::function<void ()>::operator()() const (this=0x7fe692772808) at ./deps/3rd/usr/local/oceanbase/devtools/lib/gcc/x86_64-redhat-linux/5.2.0/../../../../include/c++/5.2.0/functional:2271
#46 0x000000000b1fbc25 in oceanbase::lib::CoSetSched::Worker::run (this=0x7fe69276e568) at ./deps/oblib/src/lib/coro/co_set_sched.cpp:92
#47 0x000000000b1fa3c5 in oceanbase::lib::CoRoutine::__start (from=...) at ./deps/oblib/src/lib/coro/co_routine.cpp:137
#48 0x000000000b1f302f in make_fcontext () at /oceanbase_fuzz/oceanbase/deps/oblib/src/lib/coro/context/asm/make_x86_64_sysv_elf_gas.S:71
#49 0x0000000000000000 in ?? ()
bug