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

Data race in github.com/pingcap/tidb/util/chunk.(*RowContainer).ActionSpill() #27876

Closed
Tracked by #25899
zhouqiang-cl opened this issue Sep 8, 2021 · 3 comments · Fixed by #27881
Closed
Tracked by #25899
Assignees
Labels
severity/major sig/execution SIG execution 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!

1. Minimal reproduce step (Required)

[2021-09-08T00:49:36.411Z] Write at 0x00c05214f3a0 by goroutine 559:

[2021-09-08T00:49:36.411Z]   github.com/pingcap/tidb/util/chunk.(*RowContainer).ActionSpill()

[2021-09-08T00:49:36.411Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/chunk/row_container.go:292 +0x1114

[2021-09-08T00:49:36.411Z]   github.com/pingcap/tidb/executor.(*hashRowContainer).ActionSpill()

[2021-09-08T00:49:36.411Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/hash_table.go:227 +0xc89

[2021-09-08T00:49:36.411Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).buildHashTableForList()

[2021-09-08T00:49:36.411Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:757 +0xc61

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).fetchAndBuildHashTable()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:730 +0x2b4

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).Next.func1()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:675 +0xf0

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/util.WithRecovery()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/misc.go:100 +0x68

[2021-09-08T00:49:36.412Z] 

[2021-09-08T00:49:36.412Z] Previous read at 0x00c05214f3a0 by goroutine 187:

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/util/chunk.(*RowContainer).ShallowCopyWithNewMutex()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/chunk/row_container.go:112 +0x62f

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*hashRowContainer).ShallowCopy()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/hash_table.go:102 +0x592

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).fetchAndProbeHashTable()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:340 +0x4e5

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:677 +0x5c4

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashAggExec).fetchChildData()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:798 +0x3bd

[2021-09-08T00:49:36.412Z] 

[2021-09-08T00:49:36.412Z] Goroutine 559 (running) created at:

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashJoinExec).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/join.go:673 +0x596

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashAggExec).fetchChildData()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:798 +0x3bd

[2021-09-08T00:49:36.412Z] 

[2021-09-08T00:49:36.412Z] Goroutine 187 (running) created at:

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashAggExec).prepare4ParallelExec()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:835 +0xe4

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashAggExec).parallelExec()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:874 +0x947

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*HashAggExec).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:768 +0xe9

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).unParallelExecute()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:194 +0x1db

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:180 +0xaf

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*StreamAggExec).consumeCurGroupRowsAndFetchChild()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:1367 +0x164

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*StreamAggExec).consumeOneGroup()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:1295 +0xdf1

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*StreamAggExec).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/aggregate.go:1284 +0x108

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/executor.(*recordSet).Next()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/adapter.go:146 +0x115

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/session.(*execStmtResult).Next()

[2021-09-08T00:49:36.412Z]       <autogenerated>:1 +0x84

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/session.GetRows4Test()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:308 +0x35e

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/session.ResultSetToStringSlice()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:326 +0xba

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/testkit.(*TestKit).ResultSetToResultWithCtx()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/testkit/testkit.go:100 +0xad

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/testkit.(*TestKit).ResultSetToResult()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/testkit/testkit.go:95 +0x36f

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/testkit.(*TestKit).MustQuery()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/testkit/testkit.go:78 +0x37a

[2021-09-08T00:49:36.412Z]   github.com/pingcap/tidb/util/ranger_test.TestIndexRangeForYear()

[2021-09-08T00:49:36.412Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/ranger/ranger_test.go:1499 +0x329

[2021-09-08T00:49:36.412Z]   testing.tRunner()

[2021-09-08T00:49:36.412Z]       /usr/local/go/src/testing/testing.go:1193 +0x202

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

in ci https://ci.pingcap.net/blue/organizations/jenkins/tidb-unit-test-nightly/detail/tidb-unit-test-nightly/10350/pipeline

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@zhouqiang-cl zhouqiang-cl added the type/bug The issue is confirmed as a bug. label Sep 8, 2021
@zhouqiang-cl
Copy link
Contributor Author

happends again and again

@github-actions
Copy link

github-actions bot commented Sep 8, 2021

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

@ichn-hu
Copy link
Contributor

ichn-hu commented Sep 8, 2021

caused by #27577 and it only exists in master

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

Successfully merging a pull request may close this issue.

3 participants