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: min_distinct function panic #17276

Open
1 of 2 tasks
b41sh opened this issue Jan 14, 2025 · 1 comment
Open
1 of 2 tasks

bug: min_distinct function panic #17276

b41sh opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
C-bug Category: something isn't working found-by-sqlsmith

Comments

@b41sh
Copy link
Member

b41sh commented Jan 14, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

Version

main

What's Wrong?

############################### Crash fault info ###############################
PID: 3813428
Version: v1.2.674-nightly-009a5ebac5(rust-1.85.0-nightly-2025-01-14T02:51:01.202973956Z)
Timestamp(UTC): 2025-01-14 07:41:46.657118925 UTC
Timestamp(Local): 2025-01-14 15:41:46.657119108 +08:00
QueryId: "43c1f435-9d77-4a4c-aa83-f267b6cdc249"
Signal Message: Signal 11 (SIGSEGV), si_code 128 (Unknown), Address null points

Backtrace:
   0: backtrace::backtrace::libunwind::trace[inlined]
             at /home/b41sh/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/72265be/src/backtrace/libunwind.rs:116:5
   1: backtrace::backtrace::trace_unsynchronized[inlined]
             at /home/b41sh/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/72265be/src/backtrace/mod.rs:66:5
   2: databend_common_tracing::crash_hook::CrashHandler::recv_signal[inlined]
             at /data1/b41sh/databend/src/common/tracing/src/crash_hook.rs:101:13
   3: databend_common_tracing::crash_hook::signal_handler@7d2ff3a
             at /data1/b41sh/databend/src/common/tracing/src/crash_hook.rs:272:9
   4: <unknown>@3d1d0
   5: databend_common_expression::values::Scalar::as_ref@57f827f
             at /data1/b41sh/databend/src/query/expression/src/values.rs:362:54
   6: <databend_common_expression::types::any::AnyType as databend_common_expression::types::ValueType>::to_scalar_ref[inlined]
             at /data1/b41sh/databend/src/query/expression/src/types/any.rs:48:9
   7: <databend_common_functions::aggregates::aggregate_min_max_any::MinMaxAnyState<T,C> as databend_common_functions::aggregates::aggregate_unary::UnaryState<T,T>>::merge_result@5bdcaa0
             at /data1/b41sh/databend/src/query/functions/src/aggregates/aggregate_min_max_any.rs:257:35
   8: databend_common_functions::aggregates::aggregate_unary::AggregateUnaryFunction<S,T,R>::do_merge_result[inlined]
             at /data1/b41sh/databend/src/query/functions/src/aggregates/aggregate_unary.rs:165:13
   9: <databend_common_functions::aggregates::aggregate_unary::AggregateUnaryFunction<S,T,R> as databend_common_expression::aggregate::aggregate_function::AggregateFunction>::merge_result@5f467a5
             at /data1/b41sh/databend/src/query/functions/src/aggregates/aggregate_unary.rs:273:9
  10: <databend_common_functions::aggregates::aggregate_combinator_distinct::AggregateDistinctCombinator<State> as databend_common_expression::aggregate::aggregate_function::AggregateFunction>::merge_result@6082953
             at /data1/b41sh/databend/src/query/functions/src/aggregates/aggregate_combinator_distinct.rs:136:13
  11: <databend_common_functions::aggregates::adaptors::aggregate_ornull_adaptor::AggregateFunctionOrNullAdaptor as databend_common_expression::aggregate::aggregate_function::AggregateFunction>::merge_result@5f5bed6
             at /data1/b41sh/databend/src/query/functions/src/aggregates/adaptors/aggregate_ornull_adaptor.rs:204:21
  12: <databend_query::pipelines::processors::transforms::aggregator::transform_single_key::FinalSingleStateAggregator as databend_common_pipeline_transforms::processors::transforms::transform_accumulating::AccumulatingTransform>::on_finish@9b18f3a
             at /data1/b41sh/databend/src/query/service/src/pipelines/processors/transforms/aggregator/transform_single_key.rs:262:17
  13: <databend_common_pipeline_transforms::processors::transforms::transform_accumulating::AccumulatingTransformer<T> as databend_common_pipeline_core::processors::processor::Processor>::process@920cbb6
             at /data1/b41sh/databend/src/query/pipeline/transforms/src/processors/transforms/transform_accumulating.rs:137:37
  14: databend_common_pipeline_core::processors::processor::ProcessorPtr::process@649893d
             at /data1/b41sh/databend/src/query/pipeline/core/src/processors/processor.rs:169:9
  15: databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_sync_task[inlined]
             at /data1/b41sh/databend/src/query/service/src/pipelines/executor/executor_worker_context.rs:169:9
  16: databend_query::pipelines::executor::executor_worker_context::ExecutorWorkerContext::execute_task@8cb5af2
             at /data1/b41sh/databend/src/query/service/src/pipelines/executor/executor_worker_context.rs:132:52
  17: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_single_thread@8cd56c8
             at /data1/b41sh/databend/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:406:35
  18: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_threads::{{closure}}::{{closure}}[inlined]
             at /data1/b41sh/databend/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:378:50
  19: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
  20: std::panicking::try::do_call[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:557:40
  21: std::panicking::try[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:520:19
  22: std::panic::catch_unwind@9af5b58
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:358:14
  23: databend_common_base::runtime::catch_unwind::catch_unwind@952fb36
             at /data1/b41sh/databend/src/common/base/src/runtime/catch_unwind.rs:47:11
  24: databend_query::pipelines::executor::query_pipeline_executor::QueryPipelineExecutor::execute_threads::{{closure}}[inlined]
             at /data1/b41sh/databend/src/query/service/src/pipelines/executor/query_pipeline_executor.rs:378:34
  25: databend_common_base::runtime::runtime_tracker::ThreadTracker::tracking_function::{{closure}}::{{closure}}[inlined]
             at /data1/b41sh/databend/src/common/base/src/runtime/runtime_tracker.rs:208:17
  26: databend_common_base::runtime::thread::Thread::named_spawn::{{closure}}[inlined]
             at /data1/b41sh/databend/src/common/base/src/runtime/thread.rs:78:21
  27: std::sys::backtrace::__rust_begin_short_backtrace@8f641cd
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18
  28: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:561:17
  29: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
  30: std::panicking::try::do_call[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:557:40
  31: std::panicking::try[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:520:19
  32: std::panic::catch_unwind[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:358:14
  33: std::thread::Builder::spawn_unchecked_::{{closure}}[inlined]
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:559:30
  34: core::ops::function::FnOnce::call_once{{vtable.shim}}@93cc7bb
             at /home/b41sh/.rustup/toolchains/nightly-2024-11-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  35: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once[inlined]
             at /rustc/6b6a867ae9eac4e78d041ac4ee84be1072a48cf7/library/alloc/src/boxed.rs:1972:9
  36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once[inlined]
             at /rustc/6b6a867ae9eac4e78d041ac4ee84be1072a48cf7/library/alloc/src/boxed.rs:1972:9
  37: std::sys::pal::unix::thread::Thread::new::thread_start@b2812bb
             at /rustc/6b6a867ae9eac4e78d041ac4ee84be1072a48cf7/library/std/src/sys/pal/unix/thread.rs:105:17
  38: <unknown>@9439d
  39: <unknown>@11949c
  40: <unknown>

How to Reproduce?

root@0.0.0.0:48000/default> create table tt2(a Geometry not null);
root@0.0.0.0:48000/default> insert into tt2 values
('{"type": "Point", "coordinates": [0.6464134381888311,0.8596615070161249]}'),
('{"type": "Point", "coordinates": [0.5086088301200982,0.8877289553799534]}');
root@0.0.0.0:48000/default> select min_distinct(a) from tt2;
error: APIError: fail to POST http://0.0.0.0:48000/v1/query: error sending request for url (http://0.0.0.0:48000/v1/query)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@b41sh b41sh added C-bug Category: something isn't working found-by-sqlsmith labels Jan 14, 2025
@sundy-li
Copy link
Member

It's only reproduced in release mode.

Seems it's related to compiler.

@sundy-li sundy-li self-assigned this Feb 7, 2025
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 found-by-sqlsmith
Projects
None yet
Development

No branches or pull requests

2 participants