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 at the oomCapture #43119

Closed
Tracked by #41316
hawkingrei opened this issue Apr 18, 2023 · 0 comments · Fixed by #43121
Closed
Tracked by #41316

DATA RACE at the oomCapture #43119

hawkingrei opened this issue Apr 18, 2023 · 0 comments · Fixed by #43121
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

Write at 0x00c0008aaa20 by goroutine 111:

  runtime.mapdelete_faststr()

      GOROOT/src/runtime/map_faststr.go:301 +0x0

  golang.org/x/exp/maps.Clear[...]()

      external/org_golang_x_exp/maps/maps.go:59 +0xf1

  github.com/pingcap/tidb/util/set.StringSet.Clear()

      util/set/string_set.go:65 +0x73

  executor/oomtest/oomtest_test.(*oomCapture).ClearMessageFilter()

      executor/oomtest/oom_test.go:231 +0x3b

  executor/oomtest/oomtest_test.TestMemTracker4InsertAndReplaceExec()

      executor/oomtest/oom_test.go:120 +0x770

  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()

      domain/domain.go:1581 +0xb9

  github.com/pingcap/tidb/session.BootstrapSession()

      session/session.go:3325 +0x7cc

  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()

      domain/sysvar_cache.go:62 +0x71

  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()

      session/session.go:3672 +0x11e

  github.com/pingcap/tidb/session.(*session).ExecuteStmt()

      session/session.go:2091 +0x16b

  github.com/pingcap/tidb/session.(*session).ExecuteInternal()

      session/session.go:1626 +0x365

  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()

      domain/domain.go:1525 +0x143

  github.com/pingcap/tidb/session.BootstrapSession()

      session/session.go:3318 +0x76c

  github.com/pingcap/tidb/testkit.bootstrap()

      testkit/mockstore.go:85 +0x84

  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()

      testkit/mockstore.go:70 +0xd0

  github.com/pingcap/tidb/testkit.CreateMockStore()

      testkit/mockstore.go:62 +0x3b2

  executor/oomtest/oomtest_test.TestMemTracker4InsertAndReplaceExec()

      executor/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


Previous read at 0x00c0008aaa20 by goroutine 45775:

  runtime.mapaccess2_faststr()

      GOROOT/src/runtime/map_faststr.go:108 +0x0

  github.com/pingcap/tidb/util/set.StringSet.Exist()

      util/set/string_set.go:33 +0x144

  executor/oomtest/oomtest_test.(*oomCapture).Write()

      executor/oomtest/oom_test.go:262 +0x77

  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/disttask/framework/dispatcher.(*dispatcher).DispatchTaskLoop()

      disttask/framework/dispatcher/dispatcher.go:140 +0x6b

  github.com/pingcap/tidb/disttask/framework/dispatcher.(*dispatcher).DispatchTaskLoop-fm()

      <autogenerated>:1 +0x39

  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

      util/wait_group_wrapper.go:154 +0x87


Goroutine 111 (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/oomtest/oomtest_test.TestMain()

      executor/oomtest/oom_test.go:44 +0x326

  main.main()

      bazel-out/k8-fastbuild/bin/executor/oomtest/oomtest_test_/testmain.go:122 +0x7ce


Goroutine 45775 (running) created at:

  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()

      util/wait_group_wrapper.go:152 +0xf6

  github.com/pingcap/tidb/disttask/framework/dispatcher.(*dispatcher).Start()

      disttask/framework/dispatcher/dispatcher.go:127 +0xae

  github.com/pingcap/tidb/domain.(*Domain).distTaskFrameworkLoop.func2()

      domain/domain.go:1399 +0x2aa

  github.com/pingcap/tidb/domain.(*Domain).distTaskFrameworkLoop()

      domain/domain.go:1419 +0x316

  github.com/pingcap/tidb/domain.(*Domain).InitDistTaskLoop.func1()

      domain/domain.go:1373 +0xcb

  github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run.func1()

      util/wait_group_wrapper.go:96 +0xde

==================

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