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/parser/types.(*FieldType).EvalType() #26539

Closed
Tracked by #25899
zhouqiang-cl opened this issue Jul 26, 2021 · 5 comments
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!


25T20:26:49.953Z] WARNING: DATA RACE
[2021-07-25T20:26:49.953Z] Read at 0x00c00c4b35e8 by goroutine 108:
[2021-07-25T20:26:49.953Z]   github.com/pingcap/parser/types.(*FieldType).EvalType()
[2021-07-25T20:26:49.953Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210707071004-31c87e37af5c/types/field_type.go:96 +0x44
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/statistics.NewHistogram()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/histogram.go:96 +0x80
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/statistics.PseudoTable()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/table.go:688 +0x34c
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetPartitionStats()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:514 +0x159
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetTableStats()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:506 +0xe12
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).HandleAutoAnalyze()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/update.go:947 +0xde3
[2021-07-25T20:26:49.953Z]   github.com/pingcap/tidb/domain.(*Domain).autoAnalyzeWorker()
[2021-07-25T20:26:49.953Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/domain/domain.go:1333 +0x2ea
[2021-07-25T20:26:49.953Z] 
[2021-07-25T20:26:49.953Z] Previous write at 0x00c00c4b35e8 by goroutine 164:
[2021-07-25T20:26:49.954Z]   [failed to restore the stack]
[2021-07-25T20:26:49.954Z] 
[2021-07-25T20:26:49.954Z] Goroutine 108 (running) created at:
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/domain.(*Domain).UpdateTableStatsLoop()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/domain/domain.go:1167 +0x350
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/session.BootstrapSession()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/session.go:2617 +0x653
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).SetUpSuite()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:65 +0x15c
[2021-07-25T20:26:49.954Z]   runtime.call16()
[2021-07-25T20:26:49.954Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-07-25T20:26:49.954Z]   reflect.Value.Call()
[2021-07-25T20:26:49.954Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-07-25T20:26:49.954Z]   github.com/pingcap/check.(*suiteRunner).runFixture.func1()
[2021-07-25T20:26:49.954Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:799 +0x1d0
[2021-07-25T20:26:49.954Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-07-25T20:26:49.954Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-07-25T20:26:49.954Z] 
[2021-07-25T20:26:49.954Z] Goroutine 164 (running) created at:
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).prepare()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:271 +0xd04
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).parallelExecute()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:208 +0x5cb
[2021-07-25T20:26:49.954Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).Next()
[2021-07-25T20:26:49.954Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:181 +0x10d
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/executor.Next()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/executor.(*recordSet).Next()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/adapter.go:145 +0x115
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2021-07-25T20:26:49.955Z]       <autogenerated>:1 +0x84
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/session.GetRows4Test()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:307 +0x35e
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:325 +0xba
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:389 +0xad
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResult()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:384 +0x566
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:327 +0x571
[2021-07-25T20:26:49.955Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).TestViewColumns()
[2021-07-25T20:26:49.955Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:740 +0x7b3
[2021-07-25T20:26:49.955Z]   runtime.call16()
[2021-07-25T20:26:49.955Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-07-25T20:26:49.955Z]   reflect.Value.Call()
[2021-07-25T20:26:49.955Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-07-25T20:26:49.955Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-07-25T20:26:49.955Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-07-25T20:26:49.955Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-07-25T20:26:49.955Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-07-25T20:26:49.955Z] ==================
[2021-07-25T20:26:49.956Z] ==================
[2021-07-25T20:26:49.956Z] WARNING: DATA RACE
[2021-07-25T20:26:49.956Z] Read at 0x00c00c4b3730 by goroutine 108:
[2021-07-25T20:26:49.956Z]   github.com/pingcap/parser/types.(*FieldType).Clone()
[2021-07-25T20:26:49.956Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210707071004-31c87e37af5c/types/field_type.go:63 +0x3b5
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/statistics.NewHistogram()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/histogram.go:100 +0x4d4
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/statistics.PseudoTable()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/table.go:688 +0x34c
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetPartitionStats()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:514 +0x159
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetTableStats()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:506 +0xe12
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).HandleAutoAnalyze()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/statistics/handle/update.go:947 +0xde3
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/domain.(*Domain).autoAnalyzeWorker()
[2021-07-25T20:26:49.956Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/domain/domain.go:1333 +0x2ea
[2021-07-25T20:26:49.956Z] 
[2021-07-25T20:26:49.956Z] Previous write at 0x00c00c4b3730 by goroutine 164:
[2021-07-25T20:26:49.956Z]   [failed to restore the stack]
[2021-07-25T20:26:49.956Z] 
[2021-07-25T20:26:49.956Z] Goroutine 108 (running) created at:
[2021-07-25T20:26:49.956Z]   github.com/pingcap/tidb/domain.(*Domain).UpdateTableStatsLoop()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/domain/domain.go:1167 +0x350
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/session.BootstrapSession()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/session.go:2617 +0x653
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).SetUpSuite()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:65 +0x15c
[2021-07-25T20:26:49.957Z]   runtime.call16()
[2021-07-25T20:26:49.957Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-07-25T20:26:49.957Z]   reflect.Value.Call()
[2021-07-25T20:26:49.957Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-07-25T20:26:49.957Z]   github.com/pingcap/check.(*suiteRunner).runFixture.func1()
[2021-07-25T20:26:49.957Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:799 +0x1d0
[2021-07-25T20:26:49.957Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-07-25T20:26:49.957Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-07-25T20:26:49.957Z] 
[2021-07-25T20:26:49.957Z] Goroutine 164 (running) created at:
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).prepare()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:271 +0xd04
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).parallelExecute()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:208 +0x5cb
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).Next()
[2021-07-25T20:26:49.957Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/projection.go:181 +0x10d
[2021-07-25T20:26:49.957Z]   github.com/pingcap/tidb/executor.Next()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/executor.go:285 +0x2a8
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/executor.(*recordSet).Next()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/executor/adapter.go:145 +0x115
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2021-07-25T20:26:49.958Z]       <autogenerated>:1 +0x84
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/session.GetRows4Test()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:307 +0x35e
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/session/tidb.go:325 +0xba
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:389 +0xad
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResult()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:384 +0x566
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:327 +0x571
[2021-07-25T20:26:49.958Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).TestViewColumns()
[2021-07-25T20:26:49.958Z]       /home/jenkins/agent/workspace/tidb-unit-test-nightly/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:740 +0x7b3
[2021-07-25T20:26:49.958Z]   runtime.call16()
[2021-07-25T20:26:49.958Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-07-25T20:26:49.958Z]   reflect.Value.Call()
[2021-07-25T20:26:49.958Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-07-25T20:26:49.958Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-07-25T20:26:49.958Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-07-25T20:26:49.958Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-07-25T20:26:49.958Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-07-25T20:26:49.958Z] ==================

1. Minimal reproduce step (Required)

in ci https://ci.pingcap.net/blue/rest/organizations/jenkins/pipelines/tidb-unit-test-nightly/runs/6569/nodes/116/steps/356/log/?start=0

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@zhouqiang-cl
Copy link
Contributor Author

@tiancaiamao
Copy link
Contributor

The data race stack of the writer is lost, #27866 might be the cause.
If this data race doesn't show up in the future, we can close it.

@bb7133
Copy link
Member

bb7133 commented Sep 26, 2021

I think we can close it because of #27866.

@github-actions
Copy link

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
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.

7 participants