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

v4.0.0 panic: runtime error: invalid memory address or nil pointer dereference [recovered] #23531

Open
seiya-annie opened this issue Mar 25, 2021 · 2 comments
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@seiya-annie
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

server_configs:
tidb:
alter-primary-key: true
enable-streaming: false
experimental.allow-auto-random: false
experimental.allow-expression-index: true
mem-quota-query: 10
new_collations_enabled_on_first_bootstrap: true
oom-action: cancel
performance.feedback-probability: 0.05
performance.max-memory: 5000000
performance.max-txn-ttl: 600000
performance.query-feedback-limit: 1024
pessimistic-txn.enable: true
store: mocktikv
tikv-client.copr-cache.admission-max-result-mb: 10.0
tikv-client.copr-cache.admission-min-process-ms: 5
tikv-client.copr-cache.enable: false
tikv-client.store-liveness-timeout: 120s

use tiup deploy v4.0.0 version with above config, tidb service can't start.

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

tidb status is up

3. What did you see instead (Required)

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x21efabd]

goroutine 1 [running]:
github.com/pingcap/tidb/executor.(*ExecStmt).Exec.func1(0xc000f5b680, 0xc001164960, 0x36c53a0, 0xc000054068)
/home/jenkins/agent/workspace/tidb_v4.0.0/go/src/github.com/pingcap/tidb/executor/adapter.go:292 +0x53a
panic(0x2def7a0, 0x4c7e090)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/pingcap/tidb/util/expensivequery.(*Handle).LogOnQueryExceedMemQuota(0x0, 0x0)
/home/jenkins/agent/workspace/tidb_v4.0.0/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:90 +0x4d
github.com/pingcap/tidb/util/memory.(*PanicOnExceed).Action(0xc000fc6860, 0xc0007a00e0)
/home/jenkins/agent/workspace/tidb_v4.0.0/go/src/github.com/pingcap/tidb/util/memory/action.go:94 +0x91
github.com/pingcap/tidb/util/memory.(*Tracker).Consume(0xc0007a01c0, 0xa73)
/home/jenkins/agent/workspace/tidb_v4.0.0/go/src/github.com/pingcap/tidb/util/memory/tracker.go:221 +0x118

4. What is your TiDB version? (Required)

v4.0.0

@seiya-annie seiya-annie added type/bug The issue is confirmed as a bug. severity/critical labels Mar 25, 2021
@djshow832 djshow832 added the sig/execution SIG execution label Mar 25, 2021
@djshow832
Copy link
Contributor

When mem-quota-query is 10 and oom-action is cancel, the internal SQL exceeds the memory quota and eqh.sm is not initialized. So it panics.

@seiya-annie
Copy link
Author

error info is not clear. please fix error info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants