Throws exception: ue2::ConstructLiteralVisitor::NotLiteral
- Dominant language
- C++
- Stars
- 5.5k
- Forks
- 816
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 2
Description
When I execute following codes(**Almost for every pattern**):
```
hs_compile("foo(bar|baz)(frotz)?", HS_FLAG_ALLOWEMPTY | HS_FLAG_DOTALL | HS_FLAG_UTF8 | HS_FLAG_SINGLEMATCH,
HS_MODE_BLOCK, nullptr, &db, &compile_err);
```
it report:
```
throws exception: ue2::ConstructLiteralVisitor::NotLiteral, trace:
@ 0xea7d46e __wrap___cxa_throw
@ 0x7f174f9 ue2::ConstructLiteralVisitor::pre()
@ 0x11ea519d ue2::ComponentAlternation::accept()
@ 0x11c2bb70 ue2::ComponentSequence::accept()
@ 0x11c2bb70 ue2::ComponentSequence::accept()
@ 0x11a1fe74 ue2::shortcutLiteral()
@ 0x119376a2 ue2::addExpression()
@ 0x11934bbb ue2::hs_compile_multi_int()
@ 0x11935877 hs_compile
@ 0xfe2c469 starrocks::vectorized::LikePredicate::regex_prepare()
@ 0xc1c3a9b starrocks::vectorized::VectorizedFunctionCallExpr::open()
@ 0xb37fb05 starrocks::ExprContext::open()
@ 0xb38d597 starrocks::Expr::open()
@ 0x93d9a33 starrocks::pipeline::ProjectOperatorFactory::prepare()
@ 0xfb7c25d starrocks::pipeline::Pipeline::prepare()
@ 0xfb7f19e starrocks::pipeline::FragmentContext::prepare_all_pipelines()
@ 0xfb6ea96 starrocks::pipeline::FragmentExecutor::_prepare_pipeline_driver()
@ 0xfb7211c starrocks::pipeline::FragmentExecutor::prepare()
@ 0x1045961f starrocks::PInternalServiceImplBase<>::_exec_plan_fragment_by_pipeline()
@ 0x104587cb starrocks::PInternalServiceImplBase<>::_exec_batch_plan_fragments()
@ 0x10451d3d starrocks::PInternalServiceImplBase<>::exec_batch_plan_fragments()
@ 0xf4510bb doris::PBackendService::CallMethod()
@ 0x10fbce95 brpc::policy::ProcessRpcRequest()
@ 0x10f2fe4b brpc::ProcessInputMessage()
@ 0x10f30de1 brpc::InputMessenger::OnNewMessages()
@ 0x10f5ab02 brpc::Socket::ProcessEvent()
@ 0x10ef1407 bthread::TaskGroup::task_runner()
@ 0x1105bd31 bthread_make_fcontext
==1196635==WARNING: ASan is ignoring requested __asan_handle_no_return: stack type: default top: 0x7fda72c91300; bottom 0x7fda45c1a000; size: 0x00002d077300 (755462912)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
=================================================================
==1196635==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fda45c1c278 at pc 0x00000c9068dd bp 0x7fda45c1bdf0 sp 0x7fda45c1bde0
READ of size 8 at 0x7fda45c1c278 thread T1160
#0 0xc9068dc in std::_Rb_tree, std::less, std::allocator >::size() const /usr/include/c++/11/bits/stl_tree.h:1032
#1 0xc916e12 in std::_Rb_tree, std::less, std::allocator >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator, unsigned int const&) /usr/include/c++/11/bits/stl_tree.h:2173
#2 0x119c24c2 in std::_Rb_tree_iterator std::_Rb_tree, std::less, std::allocator >::_M_insert_unique_, std::less, std::allocator >::_Alloc_node>(std::_Rb_tree_const_iterator, unsigned int const&, std::_Rb_tree, std::less, std::allocator >::_Alloc_node&) /home/disk1/sr-deps/toolchain/installed/gcc-10.3.0/include/c++/10.3.0/bits/stl_tree.h:2264
#3 0x119c24c2 in std::enable_if, unsigned int const> >::value_type>::value, void>::type std::_Rb_tree, std::less, std::allocator >::_M_insert_range_unique, unsigned int const> >(ue2::flat_detail::iter_wrapper, unsigned int const>, ue2::flat_detail::iter_wrapper, unsigned int const>) /home/disk1/sr-deps/toolchain/installed/gcc-10.3.0/include/c++/10.3.0/bits/stl_tree.h:1109
#4 0x119c24c2 in void std::set, std::allocator >::insert, unsigned int const> >(ue2::flat_detail::iter_wrapper, unsigned int const>, ue2::flat_detail::iter_wrapper, unsigned int const>) /home/disk1/sr-deps/toolchain/installed/gcc-10.3.0/include/c++/10.3.0/bits/stl_set.h:567
#5 0x119c24c2 in void ue2::insert, std::allocator >, ue2::flat_set, std::allocator > >(std::set, std::allocator >*, ue2::flat_set, std::allocator > const&) src/util/container.h:73
#6 0x119c2267 in ue2::all_reports(ue2::NGHolder const&) src/nfagraph/ng_reports.cpp:48
#7 0x11963a2c in ue2::reduceExtendedParams(ue2::NGHolder&, ue2::ReportManager&, ue2::som_type) src/nfagraph/ng_extparam.cpp:983
#8 0x119389f5 in ue2::NG::addGraph(ue2::ExpressionInfo&, std::unique_ptr >) src/nfagraph/ng.cpp:375
#9 0x11937714 in ue2::addExpression(ue2::NG&, unsigned int, char const*, unsigned int, hs_expr_ext const*, unsigned int) src/compiler/compiler.cpp:384
#10 0x11934bba in ue2::hs_compile_multi_int(char const* const*, unsigned int const*, unsigned int const*, hs_expr_ext const* const*, unsigned int, unsigned int, hs_platform_info const*, hs_database**, hs_compile_error**, ue2::Grey const&) src/hs.cpp:239
#11 0x11935876 in hs_compile src/hs.cpp:426
#12 0xfe2c468 in starrocks::vectorized::LikePredicate::regex_prepare(starrocks_udf::FunctionContext*, starrocks_udf::FunctionContext::FunctionStateScope) /home/disk1/pslydhh/starrocks-2/be/src/exprs/vectorized/like_predicate.cpp:154
```
**v5.4.0**
Contributor guide
Assessment
This issue has not been assessed yet.