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: Resolver background goroutine races with uninstallTestHooks #21665

Closed
tombergan opened this issue Aug 28, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@tombergan
Copy link
Contributor

commented Aug 28, 2017

This is a test-only data race.

https://storage.googleapis.com/go-build-log/ca8fe3e8/linux-amd64-race_3cc1cfdc.log

==================
WARNING: DATA RACE
Write at 0x0000008ff0d0 by main goroutine:
  net.uninstallTestHooks()
      /tmp/workdir/go/src/net/main_unix_test.go:39 +0x7a
  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 +0x224

Previous read at 0x0000008ff0d0 by goroutine 28:
  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 +0x60
  net.(*conn).Close()
      /tmp/workdir/go/src/net/net.go:200 +0x60
  net.(*UDPConn).Close()
      <autogenerated>:1 +0x43
  net.(*dnsPacketConn).Close()
      <autogenerated>:1 +0x5b
  net.(*Resolver).exchange()
      /tmp/workdir/go/src/net/dnsclient_unix.go:145 +0x57f
  net.(*Resolver).tryOneName()
      /tmp/workdir/go/src/net/dnsclient_unix.go:161 +0x1ef
  net.(*Resolver).goLookupIPCNAMEOrder.func1()
      /tmp/workdir/go/src/net/dnsclient_unix.go:483 +0xa5

Goroutine 28 (finished) created at:
  net.(*Resolver).goLookupIPCNAMEOrder()
      /tmp/workdir/go/src/net/dnsclient_unix.go:482 +0x253
  net.(*Resolver).lookupIP()
      /tmp/workdir/go/src/net/lookup_unix.go:101 +0xdf
  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.136s
@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 28, 2017

Dup of #21090?

@tombergan tombergan closed this Aug 28, 2017

@golang golang locked and limited conversation to collaborators Aug 28, 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.