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

net: data race in uninstallTestHooks #21300

Closed
bcmills opened this issue Aug 3, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@bcmills
Copy link
Member

commented Aug 3, 2017

Found in https://storage.googleapis.com/go-build-log/6861ce7f/linux-amd64-race_35573c37.log.

linux-amd64-race at 6861ce7f90b59c8088a2c60b02158e184dd04195
[…]
==================
WARNING: DATA RACE
Read at 0x000000914450 by goroutine 134:
  internal/poll.(*FD).destroy()
      /tmp/workdir/go/src/internal/poll/fd_unix.go:62 +0x52
  internal/poll.(*FD).decref()
      /tmp/workdir/go/src/internal/poll/fd_mutex.go:211 +0x55
  internal/poll.(*FD).Close()
      /tmp/workdir/go/src/internal/poll/fd_unix.go:81 +0xf5
  net.(*netFD).Close()
      /tmp/workdir/go/src/net/fd_unix.go:184 +0x6a
  net.(*conn).Close()
      /tmp/workdir/go/src/net/net.go:200 +0x63
  net.(*UDPConn).Close()
      <autogenerated>:1 +0x43
  net.(*dnsPacketConn).Close()
      <autogenerated>:1 +0x5b
  net.(*Resolver).exchange()
      /tmp/workdir/go/src/net/dnsclient_unix.go:145 +0x5b2
  net.(*Resolver).tryOneName()
      /tmp/workdir/go/src/net/dnsclient_unix.go:161 +0x1f5
  net.(*Resolver).goLookupIPCNAMEOrder.func1()
      /tmp/workdir/go/src/net/dnsclient_unix.go:483 +0xb1

Previous write at 0x000000914450 by main goroutine:
  net.uninstallTestHooks()
      /tmp/workdir/go/src/net/main_unix_test.go:39 +0x80
  sync.(*Once).Do()
      /tmp/workdir/go/src/sync/once.go:44 +0xe1
  net.TestMain()
      /tmp/workdir/go/src/net/main_test.go:52 +0x6c
  main.main()
      net/_test/_testmain.go:524 +0x1cd

Goroutine 134 (running) created at:
  net.(*Resolver).goLookupIPCNAMEOrder()
      /tmp/workdir/go/src/net/dnsclient_unix.go:482 +0x256
  net.(*Resolver).lookupIP()
      /tmp/workdir/go/src/net/lookup_unix.go:101 +0xe2
  net.(*Resolver).(net.lookupIP)-fm()
      /tmp/workdir/go/src/net/lookup.go:187 +0x7f
  net.glob..func10()
      /tmp/workdir/go/src/net/hook.go:19 +0x6e
  net.(*Resolver).LookupIPAddr.func1()
      /tmp/workdir/go/src/net/lookup.go:193 +0xc9
  internal/singleflight.(*Group).doCall()
      /tmp/workdir/go/src/internal/singleflight/singleflight.go:93 +0x4c
==================
Found 1 data race(s)
FAIL	net	8.110s

(@bradfitz @dsnet @Merovius)

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 3, 2017

Dup of #21090

@bradfitz bradfitz closed this Aug 3, 2017

@golang golang locked and limited conversation to collaborators Aug 3, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.