Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: memory allocation of 2284800604532 bytes failed and databend-query hang #9497

Closed
Tracked by #9480
BohuTANG opened this issue Jan 7, 2023 · 2 comments
Closed
Tracked by #9480
Labels
C-bug Category: something isn't working new-expression

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Jan 7, 2023

Summary

version is the latest main branch.

query:

mysql> SELECT CounterID, AVG(length(URL)) AS l, COUNT(*) AS c FROM hits_expr WHERE URL <> '' GROUP BY CounterID HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25;
ERROR 1105 (HY000): Code: 1104, displayText = memory allocation of 2284800604532 bytes failed.
(gdb) bt
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x000055705df4d569 in parking_lot_core::thread_parker::imp::ThreadParker::futex_wait ()
    at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/thread_parker/linux.rs:112
#2  parking_lot_core::thread_parker::imp::{impl#0}::park () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/thread_parker/linux.rs:66
#3  parking_lot_core::parking_lot::park::{closure#0}<parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#0}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#1}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#2}> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/parking_lot.rs:635
#4  parking_lot_core::parking_lot::with_thread_data<parking_lot_core::parking_lot::ParkResult, parking_lot_core::parking_lot::park::{closure_env#0}<parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#0}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#1}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#2}>> ()
    at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/parking_lot.rs:207
#5  parking_lot_core::parking_lot::park<parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#0}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#1}, parking_lot::condvar::{impl#1}::wait_until_internal::{closure_env#2}> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.5/src/parking_lot.rs:600
#6  parking_lot::condvar::Condvar::wait_until_internal () at src/condvar.rs:333
#7  0x000055705e51a6be in parking_lot::condvar::Condvar::wait<()> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot-0.12.1/src/condvar.rs:256
#8  tokio::loom::std::parking_lot::Condvar::wait<()> () at src/loom/std/parking_lot.rs:150
#9  tokio::runtime::park::Inner::park () at src/runtime/park.rs:117
#10 0x000055705dab3ca9 in tokio::runtime::park::{impl#4}::park::{closure#0} () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/park.rs:255
#11 tokio::runtime::park::{impl#4}::with_current::{closure#0}<tokio::runtime::park::{impl#4}::park::{closure_env#0}, ()> ()
    at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/park.rs:269
#12 std::thread::local::LocalKey::try_with<tokio::runtime::park::ParkThread, tokio::runtime::park::{impl#4}::with_current::{closure_env#0}<tokio::runtime::park::{impl#4}::park::{closure_env#0}, ()>, ()> () at /rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/thread/local.rs:446
#13 tokio::runtime::park::CachedParkThread::with_current<tokio::runtime::park::{impl#4}::park::{closure_env#0}, ()> ()
    at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/park.rs:269
#14 tokio::runtime::park::CachedParkThread::park () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/park.rs:255
#15 tokio::runtime::park::CachedParkThread::block_on<common_base::runtime::catch_unwind::CatchUnwindFuture<core::future::from_generator::GenFuture<databend_query::main_entrypoint::{async_fn_env#0}>>> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/park.rs:292
#16 tokio::runtime::context::BlockingRegionGuard::block_on<common_base::runtime::catch_unwind::CatchUnwindFuture<core::future::from_generator::GenFuture<databend_query::main_entrypoint::{async_fn_env#0}>>> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/context.rs:295
#17 0x000055705db9d22c in tokio::runtime::handle::Handle::block_on<common_base::runtime::catch_unwind::CatchUnwindFuture<core::future::from_generator::GenFuture<databend_query::main_entrypoint::{async_fn_env#0}>>> () at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.1/src/runtime/handle.rs:264
#18 0x000055705db1de8b in common_base::runtime::runtime::Runtime::block_on<(), core::future::from_generator::GenFuture<databend_query::main_entrypoint::{async_fn_env#0}>> ()
    at src/common/base/src/runtime/runtime.rs:201
#19 databend_query::main () at src/binaries/query/main.rs:53
@BohuTANG BohuTANG added C-bug Category: something isn't working new-expression labels Jan 7, 2023
@BohuTANG
Copy link
Member Author

BohuTANG commented Jan 7, 2023

cc @sundy-li

The server error stack:

,
{
   "fn":"common_expression::kernels::filter::<impl common_expression::values::Column>::filter",
   "file":"/root/github/databend/src/query/expression/src/kernels/filter.rs",
   "line":201
},
{
   "fn":"common_expression::kernels::filter::<impl common_expression::block::DataBlock>::filter_with_bitmap::{{closure}}",
   "file":"/root/github/databend/src/query/expression/src/kernels/filter.rs",
   "line":156
},
{
   "fn":"core::iter::adapters::map::map_fold::{{closure}}",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/adapters/map.rs",
   "line":84
},
{
   "fn":"core::iter::traits::iterator::Iterator::fold",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/traits/iterator.rs",
   "line":2414
},
{
   "fn":"<core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/adapters/map.rs",
   "line":124
},
{
   "fn":"core::iter::traits::iterator::Iterator::for_each",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/traits/iterator.rs",
   "line":831
},
{
   "fn":"<alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/vec/spec_extend.rs",
   "line":40
},
{
   "fn":"<alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/vec/spec_from_iter_nested.rs",
   "line":62
},
{
   "fn":"<alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/vec/spec_from_iter.rs",
   "line":33
},
{
   "fn":"<alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/vec/mod.rs",
   "line":2757
},
{
   "fn":"core::iter::traits::iterator::Iterator::collect",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/traits/iterator.rs",
   "line":1836
},
{
   "fn":"common_expression::kernels::filter::<impl common_expression::block::DataBlock>::filter_with_bitmap",
   "file":"/root/github/databend/src/query/expression/src/kernels/filter.rs",
   "line":151
},
{
   "fn":"common_expression::kernels::filter::<impl common_expression::block::DataBlock>::filter",
   "file":"/root/github/databend/src/query/expression/src/kernels/filter.rs",
   "line":80
},
{
   "fn":"common_sql::evaluator::block_operator::BlockOperator::execute",
   "file":"/root/github/databend/src/query/sql/src/evaluator/block_operator.rs",
   "line":66
},
{
   "fn":"<common_sql::evaluator::block_operator::CompoundBlockOperator as common_pipeline_transforms::processors::transforms::transform::Transform>::transform::{{closure}}",
   "file":"/root/github/databend/src/query/sql/src/evaluator/block_operator.rs",
   "line":122
},
{
   "fn":"core::iter::traits::iterator::Iterator::try_fold",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/iter/traits/iterator.rs",
   "line":2238
},
{
   "fn":"<common_sql::evaluator::block_operator::CompoundBlockOperator as common_pipeline_transforms::processors::transforms::transform::Transform>::transform",
   "file":"/root/github/databend/src/query/sql/src/evaluator/block_operator.rs",
   "line":120
},
{
   "fn":"<common_pipeline_transforms::processors::transforms::transform::Transformer<T> as common_pipeline_core::processors::processor::Processor>::process",
   "file":"/root/github/databend/src/query/pipeline/transforms/src/processors/transforms/transform.rs",
   "line":86
},
{
   "fn":"common_pipeline_core::processors::processor::ProcessorPtr::process",
   "file":"/root/github/databend/src/query/pipeline/core/src/processors/processor.rs",
   "line":109
},
{
   "fn":"databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_sync_task",
   "file":"/root/github/databend/src/query/service/src/pipelines/executor/executor_worker_context.rs",
   "line":82
},
{
   "fn":"databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_task",
   "file":"/root/github/databend/src/query/service/src/pipelines/executor/executor_worker_context.rs",
   "line":73
},
{
   "fn":"databend_query::pipelines::executor::pipeline_executor::PipelineExecutor::execute_single_thread",
   "file":"/root/github/databend/src/query/service/src/pipelines/executor/pipeline_executor.rs",
   "line":313
},
{
   "fn":"databend_query::pipelines::executor::pipeline_executor::PipelineExecutor::execute_threads::{{closure}}::{{closure}}",
   "file":"/root/github/databend/src/query/service/src/pipelines/executor/pipeline_executor.rs",
   "line":269
},
{
   "fn":"<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/panic/unwind_safe.rs",
   "line":271
},
{
   "fn":"std::panicking::try::do_call",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panicking.rs",
   "line":483
},
{
   "fn":"std::panicking::try",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panicking.rs",
   "line":447
},
{
   "fn":"std::panic::catch_unwind",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panic.rs",
   "line":137
},
{
   "fn":"common_base::runtime::catch_unwind::catch_unwind",
   "file":"/root/github/databend/src/common/base/src/runtime/catch_unwind.rs",
   "line":26
},
{
   "fn":"databend_query::pipelines::executor::pipeline_executor::PipelineExecutor::execute_threads::{{closure}}",
   "file":"/root/github/databend/src/query/service/src/pipelines/executor/pipeline_executor.rs",
   "line":268
},
{
   "fn":"common_base::runtime::thread::Thread::named_spawn::{{closure}}",
   "file":"/root/github/databend/src/common/base/src/runtime/thread.rs",
   "line":83
},
{
   "fn":"std::sys_common::backtrace::__rust_begin_short_backtrace",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/sys_common/backtrace.rs",
   "line":121
},
{
   "fn":"std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/thread/mod.rs",
   "line":551
},
{
   "fn":"<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/panic/unwind_safe.rs",
   "line":271
},
{
   "fn":"std::panicking::try::do_call",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panicking.rs",
   "line":483
},
{
   "fn":"std::panicking::try",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panicking.rs",
   "line":447
},
{
   "fn":"std::panic::catch_unwind",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/panic.rs",
   "line":137
},
{
   "fn":"std::thread::Builder::spawn_unchecked_::{{closure}}",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/thread/mod.rs",
   "line":550
},
{
   "fn":"core::ops::function::FnOnce::call_once{{vtable.shim}}",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/core/src/ops/function.rs",
   "line":510
},
{
   "fn":"<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/boxed.rs",
   "line":2000
},
{
   "fn":"<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/alloc/src/boxed.rs",
   "line":2000
},
{
   "fn":"std::sys::unix::thread::Thread::new::thread_start",
   "file":"/rustc/e631891f7ad40eac3ef58ec3c2b57ecd81e40615/library/std/src/sys/unix/thread.rs",
   "line":108
},
{
   "fn":"start_thread",
   "file":"./nptl/./nptl/pthread_create.c",
   "line":442
},
{
   "fn":"clone3",
   "file":"./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S",
   "line":81
}
],
"panic.file":"src/common/base/src/runtime/runtime_tracker.rs",
"panic.line":84,
"panic.column":9

@sundy-li
Copy link
Member

sundy-li commented Jan 7, 2023

fixed in #9499

@sundy-li sundy-li closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working new-expression
Projects
None yet
Development

No branches or pull requests

2 participants