meshbird / meshbird

Distributed private networking

Home Page:https://meshbird.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data race NetTable

digitalcrab opened this issue · comments

WARNING: DATA RACE
Write by goroutine 41:
  sync/atomic.CompareAndSwapInt32()
      /tmp/workdir/go/src/runtime/race_amd64.s:279 +0xb
  sync.(*Mutex).Lock()
      /tmp/workdir/go/src/sync/mutex.go:43 +0x4d
  github.com/meshbird/meshbird/common.(*State).PrivateIP()
      /root/go/src/github.com/meshbird/meshbird/common/state.go:70 +0x53
  github.com/meshbird/meshbird/common.(*NetTable).heartbeat()
      /root/go/src/github.com/meshbird/meshbird/common/net_table.go:145 +0x201

Previous read by goroutine 142:
  reflect.Value.Int()
      /tmp/workdir/go/src/reflect/value.go:880 +0x14f
  fmt.(*pp).printReflectValue()
      /tmp/workdir/go/src/fmt/print.go:865 +0x44e
  fmt.(*pp).printValue()
      /tmp/workdir/go/src/fmt/print.go:848 +0x551
  fmt.(*pp).printReflectValue()
      /tmp/workdir/go/src/fmt/print.go:932 +0x4aa5
  fmt.(*pp).printValue()
      /tmp/workdir/go/src/fmt/print.go:848 +0x551
  fmt.(*pp).printReflectValue()
      /tmp/workdir/go/src/fmt/print.go:932 +0x4aa5
  fmt.(*pp).printValue()
      /tmp/workdir/go/src/fmt/print.go:848 +0x551
  fmt.(*pp).printReflectValue()
      /tmp/workdir/go/src/fmt/print.go:1009 +0x4352
  fmt.(*pp).printArg()
      /tmp/workdir/go/src/fmt/print.go:810 +0x652
  fmt.(*pp).doPrintf()
      /tmp/workdir/go/src/fmt/print.go:1219 +0x2a52
  fmt.Sprintf()
      /tmp/workdir/go/src/fmt/print.go:203 +0x7c
  github.com/meshbird/meshbird/log.(*ch).log()
      /root/go/src/github.com/meshbird/meshbird/log/channel.go:97 +0xe7
  github.com/meshbird/meshbird/log.(*ch).Debug()
      /root/go/src/github.com/meshbird/meshbird/log/channel.go:52 +0x69
  github.com/meshbird/meshbird/log.Debug()
      /root/go/src/github.com/meshbird/meshbird/log/public.go:43 +0x7a
  github.com/meshbird/meshbird/common.(*State).Save()
      /root/go/src/github.com/meshbird/meshbird/common/state.go:114 +0x32b
  github.com/meshbird/meshbird/common.(*State).AddGoodPeer.func1()
      /root/go/src/github.com/meshbird/meshbird/common/state.go:86 +0x32

Goroutine 41 (running) created at:
  github.com/meshbird/meshbird/common.(*NetTable).Run()
      /root/go/src/github.com/meshbird/meshbird/common/net_table.go:58 +0x1d3
  github.com/meshbird/meshbird/common.(*LocalNode).Start.func1()
      /root/go/src/github.com/meshbird/meshbird/common/localnode.go:74 +0x1db

Goroutine 142 (finished) created at:
  github.com/meshbird/meshbird/common.(*State).AddGoodPeer()
      /root/go/src/github.com/meshbird/meshbird/common/state.go:89 +0x1c7
  github.com/meshbird/meshbird/common.(*NetTable).AddRemoteNode()
      /root/go/src/github.com/meshbird/meshbird/common/net_table.go:88 +0x44c
  github.com/meshbird/meshbird/common.(*NetTable).tryConnect()
      /root/go/src/github.com/meshbird/meshbird/common/net_table.go:162 +0x172
  github.com/meshbird/meshbird/common.(*NetTable).processDHTIn()
      /root/go/src/github.com/meshbird/meshbird/common/net_table.go:122 +0x311

Any details?