databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.79k stars 742 forks source link

bug: Null points error in aggregate final #16667

Open wubx opened 13 hours ago

wubx commented 13 hours ago

Search before asking

Version

v1.2.648-nightly

What's Wrong?

############################### Crash fault info ###############################
PID: 1
TID: 4169
Version: v1.2.648-nightly-3d19b30e99(rust-1.81.0-nightly-2024-10-23T04:13:57.244054450Z)
Timestamp(UTC): 2024-10-23 07:04:24.927643958 UTC
Timestamp(Local): 2024-10-23 15:04:24.927667469 +08:00
QueryId: "4adea32e-4439-4ad5-8a90-f4a584587221"
Signal 11 (SIGSEGV), si_code 128 (Unknown), Address null points

Backtrace:
    0: backtrace::backtrace::libunwind::trace
             at /opt/rust/cargo/git/checkouts/backtrace-rs-fb1f822361417489-shallow/72265be/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /opt/rust/cargo/git/checkouts/backtrace-rs-fb1f822361417489-shallow/72265be/src/backtrace/mod.rs:66:5
      backtrace::backtrace::trace
             at /opt/rust/cargo/git/checkouts/backtrace-rs-fb1f822361417489-shallow/72265be/src/backtrace/mod.rs:53:14
   1: databend_common_tracing::panic_hook::captures_frames
             at /workspace/src/common/tracing/src/panic_hook.rs:66:5
      databend_common_tracing::crash_hook::CrashHandler::recv_signal
             at /workspace/src/common/tracing/src/crash_hook.rs:82:9
      databend_common_tracing::crash_hook::signal_handler
             at /workspace/src/common/tracing/src/crash_hook.rs:246:9
   2: <unknown>
   3: <databend_common_functions::aggregates::aggregate_unary::AggregateUnaryFunction<S,T,R> as databend_common_expression::aggregate::aggregate_function::AggregateFunction>::merge_states
             at /workspace/src/query/functions/src/aggregates/aggregate_unary.rs:265
   4: <databend_common_functions::aggregates::adaptors::aggregate_ornull_adaptor::AggregateFunctionOrNullAdaptor as databend_common_expression::aggregate::aggregate_function::AggregateFunction>::merge_states
             at /workspace/src/query/functions/src/aggregates/adaptors/aggregate_ornull_adaptor.rs:190:9
   5: databend_common_expression::aggregate::aggregate_function::AggregateFunction::batch_merge_states
             at /workspace/src/query/expression/src/aggregate/aggregate_function.rs:121:13
   6: databend_common_expression::aggregate::aggregate_hashtable::AggregateHashTable::combine_payload
             at /workspace/src/query/expression/src/aggregate/aggregate_hashtable.rs:421:17
   7: databend_common_expression::aggregate::aggregate_hashtable::AggregateHashTable::combine_payloads
             at /workspace/src/query/expression/src/aggregate/aggregate_hashtable.rs:379:13
   8: databend_query::pipelines::processors::transforms::aggregator::transform_aggregate_final::TransformFinalAggregate<Method>::transform_agg_hashtable
             at /workspace/src/query/service/src/pipelines/processors/transforms/aggregator/transform_aggregate_final.rs:83:29
   9: <databend_query::pipelines::processors::transforms::aggregator::transform_aggregate_final::TransformFinalAggregate<Method> as databend_common_pipeline_transforms::processors::transforms::transform::BlockMetaTransform<databend_query::pipelines::processors::transforms::aggregator::aggregate_meta::AggregateMeta<Method,usize>>>::transform
             at /workspace/src/query/service/src/pipelines/processors/transforms/aggregator/transform_aggregate_final.rs:152:28
  10: <databend_common_pipeline_transforms::processors::transforms::transform::BlockMetaTransformer<B,T> as databend_common_pipeline_core::processors::processor::Processor>::process
             at /workspace/src/query/pipeline/transforms/src/processors/transforms/transform.rs:309:25
  11: databend_common_pipeline_core::processors::processor::ProcessorPtr::process
             at /workspace/src/query/pipeline/core/src/processors/processor.rs:169:9
  12: databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_sync_task
             at /workspace/src/query/service/src/pipelines/executor/executor_worker_context.rs:169:9
      databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_task
             at /workspace/src/query/service/src/pipelines/executor/executor_worker_context.rs:132:52
  13: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_single_thread
             at /workspace/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:406:35
  14: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_threads::{{closure}}::{{closure}}
             at /workspace/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:378:50
      <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/panic/unwind_safe.rs:272:9
      std::panicking::try::do_call
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:553:40
      std::panicking::try
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:517:19
      std::panic::catch_unwind
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panic.rs:350:14
  15: databend_common_base::runtime::catch_unwind::catch_unwind
             at /workspace/src/common/base/src/runtime/catch_unwind.rs:47:11
  16: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_threads::{{closure}}
             at /workspace/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:378:34
      databend_common_base::runtime::runtime_tracker::ThreadTracker::tracking_function::{{closure}}::{{closure}}
             at /workspace/src/common/base/src/runtime/runtime_tracker.rs:208:17
      databend_common_base::runtime::thread::Thread::named_spawn::{{closure}}
             at /workspace/src/common/base/src/runtime/thread.rs:78:21
      std::sys::backtrace::__rust_begin_short_backtrace
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/sys/backtrace.rs:155:18
  17: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/thread/mod.rs:542:17
      <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/panic/unwind_safe.rs:272:9
      std::panicking::try::do_call
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:553:40
      std::panicking::try
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panicking.rs:517:19
      std::panic::catch_unwind
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/panic.rs:350:14
      std::thread::Builder::spawn_unchecked_::{{closure}}
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/thread/mod.rs:541:30
      core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/core/src/ops/function.rs:250:5
  18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/boxed.rs:2064:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/alloc/src/boxed.rs:2064:9
      std::sys::pal::unix::thread::Thread::new::thread_start
             at /rustc/cf2df68d1f5e56803c97d91e2b1a9f1c9923c533/library/std/src/sys/pal/unix/thread.rs:108:17
  19: start_thread
             at ./nptl/pthread_create.c:442:8
  20: __GI___clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

How to Reproduce?

No response

Are you willing to submit PR?

wubx commented 7 hours ago

set global enable_parallel_multi_merge_sort = 0; Still ecounter a null pointer.

TPCH-300 (32G memory) Q18

sundy-li commented 6 hours ago

Is it in cluster mode or standalone mode?

wubx commented 6 hours ago

Is it in cluster mode or standalone mode?

Standalone mode