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

Tikv panic for the error of Multiplication resulted in NaN: FloatIsNan #32623

Open
lilinghai opened this issue Feb 25, 2022 · 5 comments
Open
Assignees
Labels
component/tikv severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

lilinghai commented Feb 25, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (a double,b datetime);
insert into t values(0,"2004-02-23 04:43:36");
select count(*) from t where truncate(a,2018);

2. What did you expect to see? (Required)

successfully

3. What did you see instead (Required)

tikv panic

[2022/02/25 13:22:42.698 +08:00] [FATAL] [lib.rs:466] ["Multiplication resulted in NaN: FloatIsNan"] [backtrace="   0: tikv_util::set_panic_hook::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tikv_util/src/lib.rs:465:18\n   1: std::panicking::rust_panic_with_hook\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:702:17\n   2: std::panicking::begin_panic_handler::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:588:13\n   3: std::sys_common::backtrace::__rust_end_short_backtrace\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/sys_common/backtrace.rs:138:18\n   4: rust_begin_unwind\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:584:5\n   5: core::panicking::panic_fmt\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/panicking.rs:143:14\n   6: core::result::unwrap_failed\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/result.rs:1749:5\n   7: core::result::Result<T,E>::expect\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/result.rs:1022:23\n      <ordered_float::NotNan<T> as core::ops::arith::Mul<T>>::mul\n             at /rust/registry/src/github.com-1ecc6299db9ec823/ordered-float-1.1.1/src/lib.rs:425:9\n      tidb_query_expr::impl_math::truncate_real\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/impl_math.rs:482:15\n      tidb_query_expr::impl_math::truncate_real_with_int\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/impl_math.rs:470:13\n      <tidb_query_expr::types::function::Arg<Arg0_,tidb_query_expr::types::function::Arg<Arg1_,tidb_query_expr::types::function::Null>> as tidb_query_expr::impl_math::TruncateRealWithInt_Fn>::eval\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/impl_math.rs:463:1\n      <tidb_query_expr::impl_math::TruncateRealWithInt_Evaluator as tidb_query_expr::types::function::Evaluator>::eval\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/impl_math.rs:463:1\n      <tidb_query_expr::types::function::ArgConstructor<A,E> as tidb_query_expr::types::function::Evaluator>::eval\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/types/function.rs:259:17\n      <tidb_query_expr::types::function::ArgConstructor<A,E> as tidb_query_expr::types::function::Evaluator>::eval\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/types/function.rs:259:17\n   8: tidb_query_expr::impl_math::truncate_real_with_int_fn_meta::run\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/impl_math.rs:463:1\n   9: tidb_query_expr::types::expr_eval::<impl tidb_query_expr::types::expr::RpnExpression>::eval_decoded\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/types/expr_eval.rs:248:31\n  10: tidb_query_expr::types::expr_eval::<impl tidb_query_expr::types::expr::RpnExpression>::eval\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_expr/src/types/expr_eval.rs:161:9\n      tidb_query_executors::selection_executor::BatchSelectionExecutor<Src>::handle_src_result\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/selection_executor.rs:83:19\n      <tidb_query_executors::selection_executor::BatchSelectionExecutor<Src> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/selection_executor.rs:182:25\n      <tidb_query_common::execute_stats::WithSummaryCollector<C,T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/interface.rs:108:22\n  11: <alloc::boxed::Box<T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/interface.rs:77:9\n      tidb_query_executors::util::aggr_executor::AggregationExecutor<Src,I>::handle_next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/util/aggr_executor.rs:194:26\n      <tidb_query_executors::util::aggr_executor::AggregationExecutor<Src,I> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/util/aggr_executor.rs:282:22\n      <tidb_query_executors::simple_aggr_executor::BatchSimpleAggregationExecutor<Src> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/simple_aggr_executor.rs:36:9\n      <tidb_query_common::execute_stats::WithSummaryCollector<C,T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/interface.rs:108:22\n  12: <alloc::boxed::Box<T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/interface.rs:77:9\n      tidb_query_executors::runner::BatchExecutorsRunner<SS>::internal_handle_request\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/runner.rs:548:26\n  13: tidb_query_executors::runner::BatchExecutorsRunner<SS>::handle_request::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tidb_query_executors/src/runner.rs:425:41\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/mod.rs:84:19\n      <tikv::coprocessor::dag::BatchDAGHandler as tikv::coprocessor::RequestHandler>::handle_request::__handle_request::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/coprocessor/dag/mod.rs:112:50\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/mod.rs:84:19\n  14: <core::pin::Pin<P> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/future.rs:123:9\n      <tikv::coprocessor::interceptors::deadline::DeadlineChecker<F> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/coprocessor/interceptors/deadline.rs:34:9\n      <tikv::coprocessor::interceptors::tracker::Tracker<F> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/coprocessor/interceptors/tracker.rs:49:19\n  15: <tikv::coprocessor::interceptors::concurrency_limiter::ConcurrencyLimiter<PF,F> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/coprocessor/interceptors/concurrency_limiter.rs:111:15\n  16: tikv::coprocessor::endpoint::Endpoint<E>::handle_unary_request_impl::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/coprocessor/endpoint.rs:396:86\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/mod.rs:84:19\n      <resource_metering::InTags<T> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/resource_metering/src/lib.rs:250:9\n      tikv::read_pool::ReadPoolHandle::spawn_handle::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/read_pool.rs:145:28\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/mod.rs:84:19\n  17: tikv::read_pool::ReadPoolHandle::spawn::{{closure}}\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/src/read_pool.rs:121:26\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/future/mod.rs:84:19\n      yatp::task::future::RawTask<F>::poll\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/task/future.rs:59:9\n  18: yatp::task::future::TaskCell::poll\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/task/future.rs:103:9\n      <yatp::task::future::Runner as yatp::pool::runner::Runner>::handle\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/task/future.rs:387:20\n  19: <tikv_util::yatp_pool::YatpPoolRunner<T> as yatp::pool::runner::Runner>::handle\n             at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tikv_util/src/yatp_pool/mod.rs:104:24\n      <yatp::queue::multilevel::MultilevelRunner<R> as yatp::pool::runner::Runner>::handle\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/queue/multilevel.rs:245:19\n      yatp::pool::worker::WorkerThread<T,R>::run\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/pool/worker.rs:48:13\n      yatp::pool::builder::LazyBuilder<T>::build::{{closure}}\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/d564d19/src/pool/builder.rs:91:25\n      std::sys_common::backtrace::__rust_begin_short_backtrace\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/sys_common/backtrace.rs:122:18\n  20: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/thread/mod.rs:498:17\n      <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/panic/unwind_safe.rs:271:9\n      std::panicking::try::do_call\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:492:40\n      std::panicking::try\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:456:19\n      std::panic::catch_unwind\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panic.rs:137:14\n      std::thread::Builder::spawn_unchecked_::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/thread/mod.rs:497:30\n      core::ops::function::FnOnce::call_once{{vtable.shim}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/ops/function.rs:227:5\n  21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/alloc/src/boxed.rs:1854:9\n      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/alloc/src/boxed.rs:1854:9\n      std::sys::unix::thread::Thread::new::thread_start\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/sys/unix/thread.rs:108:17\n  22: start_thread\n  23: __clone\n"] [location=/rust/registry/src/github.com-1ecc6299db9ec823/ordered-float-1.1.1/src/lib.rs:425] [thread_name=unified-read-pool-10]

4. What is your TiDB version? (Required)

Release Version: v5.5.0-alpha
Edition: Community
Git Commit Hash: 171a354
Git Branch: heads/refs/tags/v5.5.0-alpha
UTC Build Time: 2022-02-20 14:52:57
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@lilinghai lilinghai added type/bug The issue is confirmed as a bug. severity/critical labels Feb 25, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Feb 28, 2022
@LemonHX
Copy link
Contributor

LemonHX commented Mar 1, 2022

could you assign to me?

@LemonHX
Copy link
Contributor

LemonHX commented Mar 1, 2022

i'll take a look

@LemonHX
Copy link
Contributor

LemonHX commented Mar 2, 2022

@lilinghai fixed in pr tikv/tikv#12065

@you06
Copy link
Contributor

you06 commented Mar 21, 2022

The pushdown of truncate is forbidden by #32740, and it no more affects 6.0. Can we remove affects-6.0 and downgrade the severity? BTW I tried v5.4.0 and v5.3.0, it works also.

@you06
Copy link
Contributor

you06 commented Mar 21, 2022

cc @ChenPeng2013

@you06 you06 added severity/moderate and removed severity/critical may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. affects-6.0 labels Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tikv severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

7 participants