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

race detector failures #100

Closed
josharian opened this issue Nov 14, 2020 · 4 comments
Closed

race detector failures #100

josharian opened this issue Nov 14, 2020 · 4 comments

Comments

@josharian
Copy link

I started up conprof built with -race and almost immediately got complaints:

or/github.com/conprof/db/tsdb/chunkenc/byte.go:172 +0x48f
  github.com/conprof/db/tsdb.(*memSeries).append()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:2130 +0x198
  github.com/conprof/db/tsdb.(*Head).processWALSamples()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:372 +0x3fd
  github.com/conprof/db/tsdb.(*Head).loadWAL.func5()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:466 +0x66

Previous write at 0x00c000f62010 by goroutine 55:
  runtime.slicecopy()
      /Users/josh/go/1.15/src/runtime/slice.go:246 +0x0
  github.com/conprof/db/tsdb/wal.(*Reader).next()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/wal/reader.go:134 +0xe04
  github.com/conprof/db/tsdb/wal.(*Reader).Next()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/wal/reader.go:45 +0x44
  github.com/conprof/db/tsdb.(*Head).loadWAL.func6()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:474 +0x9d

Goroutine 34 (running) created at:
  github.com/conprof/db/tsdb.(*Head).loadWAL()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:465 +0x549
  github.com/conprof/db/tsdb.(*Head).Init()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:713 +0xdf0
  github.com/conprof/db/tsdb.open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:660 +0xb84
  github.com/conprof/db/tsdb.Open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:530 +0xe4
  main.runAll()
      /Users/josh/x/conprof/all.go:46 +0x20c
  main.registerAll.func1()
      /Users/josh/x/conprof/all.go:41 +0x1d4
  main.main()
      /Users/josh/x/conprof/main.go:131 +0x1f4e

Goroutine 55 (running) created at:
  github.com/conprof/db/tsdb.(*Head).loadWAL()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:472 +0x70d
  github.com/conprof/db/tsdb.(*Head).Init()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:713 +0xdf0
  github.com/conprof/db/tsdb.open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:660 +0xb84
  github.com/conprof/db/tsdb.Open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:530 +0xe4
  main.runAll()
      /Users/josh/x/conprof/all.go:46 +0x20c
  main.registerAll.func1()
      /Users/josh/x/conprof/all.go:41 +0x1d4
  main.main()
      /Users/josh/x/conprof/main.go:131 +0x1f4e
==================
==================
WARNING: DATA RACE
Read at 0x00c000f6ff40 by goroutine 34:
  runtime.slicecopy()
      /Users/josh/go/1.15/src/runtime/slice.go:246 +0x0
  github.com/conprof/db/tsdb/chunkenc.(*bytesAppender).Append()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/chunkenc/byte.go:172 +0x48f
  github.com/conprof/db/tsdb.(*memSeries).append()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:2130 +0x198
  github.com/conprof/db/tsdb.(*Head).processWALSamples()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:372 +0x3fd
  github.com/conprof/db/tsdb.(*Head).loadWAL.func5()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:466 +0x66

Previous write at 0x00c000f6ff45 by goroutine 55:
  [failed to restore the stack]

Goroutine 34 (running) created at:
  github.com/conprof/db/tsdb.(*Head).loadWAL()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:465 +0x549
  github.com/conprof/db/tsdb.(*Head).Init()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:713 +0xdf0
  github.com/conprof/db/tsdb.open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:660 +0xb84
  github.com/conprof/db/tsdb.Open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:530 +0xe4
  main.runAll()
      /Users/josh/x/conprof/all.go:46 +0x20c
  main.registerAll.func1()
      /Users/josh/x/conprof/all.go:41 +0x1d4
  main.main()
      /Users/josh/x/conprof/main.go:131 +0x1f4e

Goroutine 55 (running) created at:
  github.com/conprof/db/tsdb.(*Head).loadWAL()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:472 +0x70d
  github.com/conprof/db/tsdb.(*Head).Init()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/head.go:713 +0xdf0
  github.com/conprof/db/tsdb.open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:660 +0xb84
  github.com/conprof/db/tsdb.Open()
      /Users/josh/x/conprof/vendor/github.com/conprof/db/tsdb/db.go:530 +0xe4
  main.runAll()
      /Users/josh/x/conprof/all.go:46 +0x20c
  main.registerAll.func1()
      /Users/josh/x/conprof/all.go:41 +0x1d4
  main.main()
      /Users/josh/x/conprof/main.go:131 +0x1f4e
==================

Maybe a cause of #36?

@brancz
Copy link
Member

brancz commented Nov 14, 2020

Yeah I’ve noticed this recently as well, it appears to be rather severe, sometimes so bad that discovery doesn’t start this scraping doesn’t start.

@brancz
Copy link
Member

brancz commented Nov 14, 2020

I’m gonna try to have a look at this next week.

@brancz
Copy link
Member

brancz commented Nov 30, 2020

This should be fixed (through: conprof/db@173f6e8#diff-b64b52f2cd0b36cf8b064c3bf3630f5ff837d1bde5d780cca16b1dd10b7f82b3R183). Could you double check this? I can't reproduce any obvious races anymore.

Thank you so much for reporting this!

@brancz
Copy link
Member

brancz commented Dec 3, 2020

I've tried for a couple of days now and haven't been able to reproduce any races, I'm gonna go ahead and close this, but please feel free to continue to comment or open a new issue if you should encounter any other race with the latest version!

@brancz brancz closed this as completed Dec 3, 2020
brancz pushed a commit that referenced this issue Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants