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

TiDB panic(runtime error: invalid memory address or nil pointer dereference) #18060

Closed
zhouqiang-cl opened this issue Jun 16, 2020 · 1 comment
Labels
duplicate Issues or pull requests already exists. epic/plan-cache severity/major type/bug The issue is confirmed as a bug.

Comments

@zhouqiang-cl
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

[2020/06/16 20:46:31.798 +08:00] [ERROR] [conn.go:663] ["connection running loop panic"] [conn=18] [lastSQL="SELECT *, (unix_timestamp(Time) + 0E0) as timestamp FROM `INFORMATION_SCHEMA`.`CLUSTER_SLOW_QUERY`  WHERE (time between from_unixtime(?) and from_unixtime(?)) ORDER BY Time desc LIMIT 100 [arguments: (1592309791, 1592311591)]"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 2062 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x6847500, 0xc00156a8a0, 0xc000ffb6c0)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/server/conn.go:661 +0xee\npanic(0x5ee0960, 0x81e1cd0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/util/chunk.Row.IsNull(...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/util/chunk/row.go:207\ngithub.com/pingcap/tidb/expression.(*Column).EvalTime(0xc000191680, 0x688cc20, 0xc00201e000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/column.go:404 +0x1c\ngithub.com/pingcap/tidb/expression.(*builtinUnixTimestampDecSig).evalDecimal(0xc001542b00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin_time.go:4820 +0x71\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).EvalDecimal(...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:359\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc001752730, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:325 +0x228\ngithub.com/pingcap/tidb/expression.(*Constant).getLazyDatum(0xc000f77d40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/constant.go:183 +0x99\ngithub.com/pingcap/tidb/expression.(*Constant).EvalDecimal(0xc000f77d40, 0x688cc20, 0xc00201e000, 0x0, 0x0, 0x203000, 0xc00132a7e8, 0x12003562, 0x203000)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/constant.go:273 +0x5a\ngithub.com/pingcap/tidb/expression.(*builtinCastDecimalAsRealSig).evalReal(0xc001542bb0, 0x0, 0x0, 0xc0014527d0, 0xc00132a8b8, 0xc00132a858, 0x400ec76)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin_cast.go:1004 +0x6e\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).EvalReal(...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:354\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc001752780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:323 +0xe6\ngithub.com/pingcap/tidb/expression.foldConstant(0x68bc580, 0xc001752780, 0x400f4e8, 0x50, 0x60604c0)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/constant_fold.go:197 +0x1072\ngithub.com/pingcap/tidb/expression.FoldConstant(0x68bc580, 0xc001752780, 0x6298bc5, 0x4)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/constant_fold.go:36 +0x39\ngithub.com/pingcap/tidb/expression.BuildCastFunction(0x688cc20, 0xc00201e000, 0x68bc300, 0xc000f77d40, 0xc0018e7260, 0x100000000000014, 0x8)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin_cast.go:1805 +0x2d3\ngithub.com/pingcap/tidb/expression.WrapWithCastAsReal(0x688cc20, 0xc00201e000, 0x68bc300, 0xc000f77d40, 0x203000, 0x7)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin_cast.go:1833 +0x14f\ngithub.com/pingcap/tidb/expression.newBaseBuiltinFuncWithTp(0x688cc20, 0xc00201e000, 0x6298f8d, 0x4, 0xc0016c7360, 0x2, 0x2, 0xc00165ea01, 0xc0016e5066, 0x2, ...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin.go:144 +0x52f\ngithub.com/pingcap/tidb/expression.(*arithmeticPlusFunctionClass).getFunction(0xc0003187c0, 0x688cc20, 0xc00201e000, 0xc0016c7360, 0x2, 0x2, 0x4, 0x2, 0xc0, 0x60cfcc0)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/builtin_arithmetic.go:163 +0x1ca\ngithub.com/pingcap/tidb/expression.newFunctionImpl(0x688cc20, 0xc00201e000, 0x1, 0x6298f8d, 0x4, 0xc0018e7200, 0xc00165e940, 0x2, 0x4, 0x60, ...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:201 +0x240\ngithub.com/pingcap/tidb/expression.NewFunction(...)\n\t/Users/pingcap/gopkg/src/github.com/pingcap/tidb/expression/scalar_function.go:221\ngithub.com/pingcap/tidb/planner/core.(*expressionRewriter).newFunction(0xc0015bbe10, 0x6298f8d, 0x4, 0xc0018e7200, 0xc00165e940, 0x2, 0x4, 0x0, 0x0, 0xc00132b458, ...)\n\t/Users/pingcap/gopkg/"]

1. Minimal reproduce step (Required)

TiDB config

lease = "40s"
mem-quota-query = 981009012
oom-action = "log"
oom-use-tmp-storage = true
tmp-storage-quota = 1073741824

[performance]
bind-info-lease = "3.392221425s"
feedback-probability = 0.25775957759746204
max-memory = 0
query-feedback-limit = 3455
stats-lease = "2.167476859s"

[prepared-plan-cache]
capacity = 497
enabled = true
memory-guard-ratio = 0.4591444936218132

[stmt-summary]
history-size = 28
max-sql-length = 2247
max-stmt-count = 82
refresh-interval = 1615

[tikv-client]
commit-timeout = "40.7s"
grpc-connection-count = 52
max-batch-size = 204
max-batch-wait-time = 854333883
[tikv-client.copr-cache]
admission-max-result-mb = 94.67918521143564
admission-min-process-ms = 31
capacity-mb = 8717.53720422519
enable = false
  1. start tidb with this config
  2. open dashboard, then the error appear

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

No errors

3. What did you see instead (Required)

has panic

4. Affected version (Required)

["Release Version"=v4.0.0-beta.2-611-gb2922a709] 
[Edition=Community] 
["Git Commit Hash"=b2922a70987e0b3a9b5e1392375af156162de346] ["Git Branch"=HEAD] ["UTC Build Time"="2020-06-10 07:59:05"] [GoVersion=go1.13.4] 
["Race Enabled"=false]
 ["Check Table Before Drop"=false] ["TiKV Min Version"=v3.0.0-60965b006877ca7234adaced7890d7b029ed1306]

5. Root Cause Analysis

@zhouqiang-cl zhouqiang-cl added the type/bug The issue is confirmed as a bug. label Jun 16, 2020
@zhouqiang-cl zhouqiang-cl changed the title TiDB panic TiDB panic(runtime error: invalid memory address or nil pointer dereference) Jun 16, 2020
@zhouqiang-cl
Copy link
Contributor Author

fixed by #17855

@zz-jason zz-jason added the duplicate Issues or pull requests already exists. label Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues or pull requests already exists. epic/plan-cache severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants