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 when running a banking workload #30368

Closed
dbsid opened this issue Dec 3, 2021 · 3 comments
Closed

TiDB panic when running a banking workload #30368

dbsid opened this issue Dec 3, 2021 · 3 comments
Assignees
Labels
found/automation Found by automation tests severity/critical sig/diagnosis SIG: Diagnosis type/bug The issue is confirmed as a bug.

Comments

@dbsid
Copy link
Contributor

dbsid commented Dec 3, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

run a workload simulation

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

no tidb panic

3. What did you see instead (Required)

tidb panic

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

goroutine 27438774 [running]:
github.com/pingcap/tidb/parser.(*reader).peek(0xc102d29200, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/lexer.go:945 +0x4f
github.com/pingcap/tidb/parser.(*Scanner).scan(0xc102d29200, 0xc102d29200, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/lexer.go:305 +0x45
github.com/pingcap/tidb/parser.(*sqlDigester).normalize(0xc03b1a33e0, 0x0, 0x10)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:169 +0xdb
github.com/pingcap/tidb/parser.(*sqlDigester).doNormalizeDigest(0xc03b1a33e0, 0x0, 0x10, 0x0, 0x38db480, 0x5f90520)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:148 +0x45
github.com/pingcap/tidb/parser.NormalizeDigest(0x0, 0x10, 0x61dd108, 0xc1131883f0, 0x203001)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:96 +0x6d
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).SQLDigest.func1()
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:273 +0x46
sync.(*Once).doSlow(0xc0068993d0, 0xc056d032a0)
	/usr/local/go/src/sync/once.go:68 +0xec
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:59
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).SQLDigest(0xc0068991d8, 0x1ffdaf5, 0xc07648b0e5, 0x5b15c50)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:272 +0x93
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).GetResourceGroupTagByLabel(0xc0068991d8, 0x2, 0x41, 0x2, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:306 +0x34
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).GetResourceGroupTagger.func1(0xc00505c280)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:296 +0x89
github.com/tikv/client-go/v2/txnkv/transaction.actionCommit.handleSingleBatch(0x0, 0xc09c7c6a80, 0xc0bab787e0, 0xa24, 0x5, 0x291, 0x431d288, 0xc0d7b1b800, 0x0, 0x0, ...)
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/commit.go:77 +0x21c6
github.com/tikv/client-go/v2/txnkv/transaction.(*batchExecutor).startWorker.func1(0xc01d818400, 0xc0b508b200, 0xa24, 0x5, 0x291, 0x431d288, 0xc0d7b1b800, 0x0)
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1804 +0x197
created by github.com/tikv/client-go/v2/txnkv/transaction.(*batchExecutor).startWorker
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1787 +0x19e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1ceb00f]

goroutine 7215792 [running]:
github.com/pingcap/tidb/parser.(*reader).peek(0xc012937f00, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/lexer.go:945 +0x4f
github.com/pingcap/tidb/parser.(*Scanner).scan(0xc012937f00, 0xc012937f00, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/lexer.go:305 +0x45
github.com/pingcap/tidb/parser.(*sqlDigester).normalize(0xc01b9d50e0, 0x0, 0x26)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:169 +0xdb
github.com/pingcap/tidb/parser.(*sqlDigester).doNormalizeDigest(0xc01b9d50e0, 0x0, 0x26, 0x1, 0x38db480, 0x5f90520)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:148 +0x45
github.com/pingcap/tidb/parser.NormalizeDigest(0x0, 0x26, 0x24, 0xc00c3aecc0, 0x203004)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/parser/digester.go:96 +0x6d
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).SQLDigest.func1()
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:273 +0x46
sync.(*Once).doSlow(0xc00ddc4dd0, 0xc00e6552a0)
	/usr/local/go/src/sync/once.go:68 +0xec
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:59
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).SQLDigest(0xc00ddc4bd8, 0x1ffdaf5, 0xc01133002d, 0x5b15c50)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:272 +0x93
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).GetResourceGroupTagByLabel(0xc00ddc4bd8, 0x2, 0x30, 0x2, 0x0)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:306 +0x34
github.com/pingcap/tidb/sessionctx/stmtctx.(*StatementContext).GetResourceGroupTagger.func1(0xc0125b9040)
	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go:296 +0x89
github.com/tikv/client-go/v2/txnkv/transaction.actionCommit.handleSingleBatch(0x0, 0xc01f894c00, 0xc014313050, 0x13b4, 0x5, 0x516, 0x431d288, 0xc00a0d1920, 0x1, 0x0, ...)
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/commit.go:77 +0x21c6
github.com/tikv/client-go/v2/txnkv/transaction.(*batchExecutor).startWorker.func1(0xc008b90000, 0xc016881d40, 0x13b4, 0x5, 0x516, 0x431d288, 0xc00a0d1920, 0x1)
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1804 +0x197
created by github.com/tikv/client-go/v2/txnkv/transaction.(*batchExecutor).startWorker
	/nfs/cache/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1787 +0x19e

4. What is your TiDB version? (Required)

| Release Version: v5.4.0-alpha-278-ga04601477
Edition: Community
Git Commit Hash: a04601477600b6804d7a4a2bd31a923bed7817c7
Git Branch: master
UTC Build Time: 2021-12-01 03:36:18
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |```
@dbsid dbsid added type/bug The issue is confirmed as a bug. severity/critical found/automation Found by automation tests labels Dec 3, 2021
@zyguan
Copy link
Contributor

zyguan commented Dec 3, 2021

related to #30252

@jebter jebter assigned crazycs520 and unassigned bb7133 Dec 7, 2021
@jebter jebter added the sig/diagnosis SIG: Diagnosis label Dec 7, 2021
@crazycs520
Copy link
Contributor

this should be fix by #30296

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
found/automation Found by automation tests severity/critical sig/diagnosis SIG: Diagnosis type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants