Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Data race in auth package #1639

Closed
russjones opened this issue Jan 29, 2018 · 0 comments · Fixed by #1686
Closed

Data race in auth package #1639

russjones opened this issue Jan 29, 2018 · 0 comments · Fixed by #1686
Assignees

Comments

@russjones
Copy link
Contributor

Found the following data race in 9359f6d running go test -race -v ./... -check.f=TestAudit on our macOS cloud box.

==================
WARNING: DATA RACE
Write at 0x000005c0aff0 by goroutine 122:
  github.com/gravitational/teleport/lib/auth/native.(*nauth).Close()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:79 +0xae
  github.com/gravitational/teleport/lib/reversetunnel.(*certificateCache).generateHostCert()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/cache.go:164 +0x4ce
  github.com/gravitational/teleport/lib/reversetunnel.(*certificateCache).GetHostCertificate()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/cache.go:73 +0x111
  github.com/gravitational/teleport/lib/reversetunnel.(*localSite).dialWithAgent()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/localsite.go:163 +0x1e5
  github.com/gravitational/teleport/lib/reversetunnel.(*localSite).Dial()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/localsite.go:147 +0x129
  github.com/gravitational/teleport/lib/srv/regular.(*proxySubsys).proxyToHost()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/proxy.go:301 +0xa2a
  github.com/gravitational/teleport/lib/srv/regular.(*proxySubsys).Start()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/proxy.go:190 +0x621
  github.com/gravitational/teleport/lib/srv/regular.(*Server).handleSubsystem()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:912 +0x313
  github.com/gravitational/teleport/lib/srv/regular.(*Server).dispatch()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:787 +0x59a
  github.com/gravitational/teleport/lib/srv/regular.(*Server).handleSessionRequests()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:758 +0x3aa

Previous read at 0x000005c0aff0 by goroutine 23:
  github.com/gravitational/teleport/lib/auth/native.(*nauth).precalculateKeys()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:110 +0x14f

Goroutine 122 (running) created at:
  github.com/gravitational/teleport/lib/srv/regular.(*Server).HandleNewChan()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:619 +0x52f

Goroutine 23 (running) created at:
  github.com/gravitational/teleport/lib/auth/native.New()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:67 +0x155
  github.com/gravitational/teleport/integration.NewInstance()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/helpers.go:140 +0x6a
  github.com/gravitational/teleport/integration.(*IntSuite).newTeleportWithConfig()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/integration_test.go:138 +0x14d
  github.com/gravitational/teleport/integration.(*IntSuite).TestAuditOff()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/integration_test.go:1558 +0x11c
  runtime.call32()
      /usr/local/go/src/runtime/asm_amd64.s:509 +0x3a
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:302 +0xc0
  github.com/gravitational/teleport/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/vendor/gopkg.in/check.v1/check.go:763 +0x9b0
  github.com/gravitational/teleport/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/vendor/gopkg.in/check.v1/check.go:657 +0x89
==================
==================
WARNING: DATA RACE
Write at 0x000005c0aff8 by goroutine 122:
  github.com/gravitational/teleport/lib/auth/native.(*nauth).Close()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:80 +0xfc
  github.com/gravitational/teleport/lib/reversetunnel.(*certificateCache).generateHostCert()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/cache.go:164 +0x4ce
  github.com/gravitational/teleport/lib/reversetunnel.(*certificateCache).GetHostCertificate()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/cache.go:73 +0x111
  github.com/gravitational/teleport/lib/reversetunnel.(*localSite).dialWithAgent()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/localsite.go:163 +0x1e5
  github.com/gravitational/teleport/lib/reversetunnel.(*localSite).Dial()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/reversetunnel/localsite.go:147 +0x129
  github.com/gravitational/teleport/lib/srv/regular.(*proxySubsys).proxyToHost()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/proxy.go:301 +0xa2a
  github.com/gravitational/teleport/lib/srv/regular.(*proxySubsys).Start()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/proxy.go:190 +0x621
  github.com/gravitational/teleport/lib/srv/regular.(*Server).handleSubsystem()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:912 +0x313
  github.com/gravitational/teleport/lib/srv/regular.(*Server).dispatch()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:787 +0x59a
  github.com/gravitational/teleport/lib/srv/regular.(*Server).handleSessionRequests()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:758 +0x3aa

Previous read at 0x000005c0aff8 by goroutine 23:
  github.com/gravitational/teleport/lib/auth/native.(*nauth).precalculateKeys()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:107 +0x132

Goroutine 122 (running) created at:
  github.com/gravitational/teleport/lib/srv/regular.(*Server).HandleNewChan()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/srv/regular/sshserver.go:619 +0x52f

Goroutine 23 (running) created at:
  github.com/gravitational/teleport/lib/auth/native.New()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/lib/auth/native/native.go:67 +0x155
  github.com/gravitational/teleport/integration.NewInstance()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/helpers.go:140 +0x6a
  github.com/gravitational/teleport/integration.(*IntSuite).newTeleportWithConfig()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/integration_test.go:138 +0x14d
  github.com/gravitational/teleport/integration.(*IntSuite).TestAuditOff()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/integration/integration_test.go:1558 +0x11c
  runtime.call32()
      /usr/local/go/src/runtime/asm_amd64.s:509 +0x3a
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:302 +0xc0
  github.com/gravitational/teleport/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/vendor/gopkg.in/check.v1/check.go:763 +0x9b0
  github.com/gravitational/teleport/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /tmp/teleport-tests/src/github.com/gravitational/teleport/vendor/gopkg.in/check.v1/check.go:657 +0x89
==================
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants