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 the oomCapture #44949

Closed
Tracked by #41316
hawkingrei opened this issue Jun 26, 2023 · 0 comments · Fixed by #44952
Closed
Tracked by #41316

DATA RACE in the oomCapture #44949

hawkingrei opened this issue Jun 26, 2023 · 0 comments · Fixed by #44952
Labels
component/test severity/moderate type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

3. What did you see instead (Required)

==================
WARNING: DATA RACE
Read at 0x00c00116a900 by goroutine 47396:
  github.com/pingcap/tidb/util/set.StringSet.Empty()
      util/set/string_set.go:60 +0x1c4
  executor/test/oomtest/oomtest_test.(*oomCapture).Write()
      executor/test/oomtest/oom_test.go:269 +0x16f
  go.uber.org/zap/zapcore.(*CheckedEntry).Write()
      external/org_uber_go_zap/zapcore/entry.go:255 +0x2ce
  go.uber.org/zap.(*Logger).Info()
      external/org_uber_go_zap/logger.go:220 +0x6a
  github.com/pingcap/tidb/domain/infosync.SetTiFlashGroupConfig()
      domain/infosync/info.go:1149 +0xce
  github.com/pingcap/tidb/ddl.(*ddl).PollTiFlashRoutine()
      ddl/ddl_tiflash_api.go:579 +0x519
  github.com/pingcap/tidb/ddl.(*ddl).PollTiFlashRoutine-fm()
      <autogenerated>:1 +0x39
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x87
Previous write at 0x00c00116a900 by goroutine 113:
  runtime.mapassign_faststr()
      GOROOT/src/runtime/map_faststr.go:203 +0x0
  github.com/pingcap/tidb/util/set.StringSet.Insert()
      util/set/string_set.go:39 +0xc7
  executor/test/oomtest/oomtest_test.(*oomCapture).AddMessageFilter()
      executor/test/oomtest/oom_test.go:227 +0x65
  executor/test/oomtest/oomtest_test.TestMemTracker4InsertAndReplaceExec()
      executor/test/oomtest/oom_test.go:138 +0xa77
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3379 +0x7cc
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x71
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3743 +0x11e
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2152 +0x16b
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1666 +0x365
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1832 +0x143
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3372 +0x76c
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x4e
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:227 +0x84
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:200 +0xd0
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:68 +0x3b2
  executor/test/oomtest/oomtest_test.TestMemTracker4InsertAndReplaceExec()
      executor/test/oomtest/oom_test.go:71 +0x4f
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 47396 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()
      util/wait_group_wrapper.go:152 +0xf6
  github.com/pingcap/tidb/ddl.(*ddl).Start()
      ddl/ddl.go:802 +0xb79
  github.com/pingcap/tidb/domain.(*Domain).Init()
      domain/domain.go:1209 +0x1319
  github.com/pingcap/tidb/session.(*domainMap).Get.func1()
      session/tidb.go:93 +0x67c
  github.com/pingcap/tidb/util.RunWithRetry()
      util/misc.go:69 +0xbe
  github.com/pingcap/tidb/session.(*domainMap).Get()
      session/tidb.go:79 +0x2f8
  github.com/pingcap/tidb/session.createSessionWithOpt()
      session/session.go:3600 +0x86
  github.com/pingcap/tidb/session.createSession()
      session/session.go:3592 +0x49
  github.com/pingcap/tidb/session.createSessionsImpl()
      session/session.go:3577 +0xa1
  github.com/pingcap/tidb/session.createSessions()
      session/session.go:3564 +0x64
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3339 +0x45d
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x4e
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:227 +0x84
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:200 +0xd0
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:68 +0x3b2
  executor/test/oomtest/oomtest_test.TestMemTracker4InsertAndReplaceExec()
      executor/test/oomtest/oom_test.go:71 +0x4f
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 113 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1629 +0x805
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:2036 +0x8d
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.runTests()
      GOROOT/src/testing/testing.go:2034 +0x87c
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1906 +0xb44
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  executor/test/oomtest/oomtest_test.TestMain()
      executor/test/oomtest/oom_test.go:44 +0x326
  main.main()
      bazel-out/k8-fastbuild/bin/executor/test/oomtest/oomtest_test_/testmain.go:127 +0x7ce
================== 

4. What is your TiDB version? (Required)

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

Successfully merging a pull request may close this issue.

1 participant