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 races on deadline vars #4434

Closed
dvyukov opened this issue Nov 25, 2012 · 7 comments
Closed

net: data races on deadline vars #4434

dvyukov opened this issue Nov 25, 2012 · 7 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Nov 25, 2012

14949:d351a7cc9ca9 tip
Patch in issue #6845091: net: add deadline prolongation test

$ go test -race -run=TestProlongTimeout net

WARNING: DATA RACE
Write by goroutine 5:
  net.setWriteDeadline()
      src/pkg/net/sockopt_posix.go:135 +0xdf
  net.setDeadline()
      src/pkg/net/sockopt_posix.go:144 +0x9c
  net.(*conn).SetDeadline()
      src/pkg/net/net.go:161 +0xe3
  net.func·059()
      src/pkg/net/timeout_test.go:616 +0x168

Previous read by goroutine 4:
  net.(*pollServer).AddFD()
      src/pkg/net/fd_unix.go:89 +0x398
  net.(*pollServer).WaitWrite()
      src/pkg/net/fd_unix.go:249 +0x45
  net.(*netFD).Write()
      src/pkg/net/fd_unix.go:552 +0x42b
  net.(*conn).Write()
      src/pkg/net/net.go:129 +0x101
  net.func·058()
      src/pkg/net/timeout_test.go:603 +0x106

WARNING: DATA RACE
Read by goroutine 4:
  net.(*netFD).Write()
      src/pkg/net/fd_unix.go:533 +0x12e
  net.(*conn).Write()
      src/pkg/net/net.go:129 +0x101
  net.func·058()
      src/pkg/net/timeout_test.go:603 +0x106

Previous write by goroutine 5:
  net.setWriteDeadline()
      src/pkg/net/sockopt_posix.go:135 +0xdf
  net.setDeadline()
      src/pkg/net/sockopt_posix.go:144 +0x9c
  net.(*conn).SetDeadline()
      src/pkg/net/net.go:161 +0xe3
  net.func·059()
      src/pkg/net/timeout_test.go:616 +0x168

WARNING: DATA RACE
Write by goroutine 5:
  net.setWriteDeadline()
      src/pkg/net/sockopt_posix.go:135 +0xdf
  net.setDeadline()
      src/pkg/net/sockopt_posix.go:144 +0x9c
  net.(*conn).SetDeadline()
      src/pkg/net/net.go:161 +0xe3
  net.func·059()
      src/pkg/net/timeout_test.go:616 +0x168

Previous read by goroutine 4:
  net.(*netFD).Write()
      src/pkg/net/fd_unix.go:551 +0x41d
  net.(*conn).Write()
      src/pkg/net/net.go:129 +0x101
  net.func·058()
      src/pkg/net/timeout_test.go:603 +0x106
@davecheney
Copy link
Contributor

Comment 1:

I'll take this one, I already have a small CL which was based on the suspicion there was
a race here.

Owner changed to @davecheney.

Status changed to Accepted.

@dvyukov
Copy link
Member Author

dvyukov commented Nov 25, 2012

Comment 2:

FTR:
> Just using atomics for deadlines won't help, there are logical races.
> For example, I think, currently it's possible that when you are
> extending a deadline and the first deadline is triggered, you will end
> up with deadline set to -1 (even if the second deadline should not be
> triggered yet).

@davecheney
Copy link
Contributor

Comment 3:

So noted.

@davecheney
Copy link
Contributor

Comment 4:

This issue was closed by revision be0d84e.

Status changed to Fixed.

@davecheney
Copy link
Contributor

Comment 5:

This issue was closed by revision 5b425cc.

@davecheney
Copy link
Contributor

Comment 6:

reopening, blocked on workaround for issue #599.
https://golang.org/cl/6842127/

Status changed to Started.

@davecheney
Copy link
Contributor

Comment 7:

This issue was closed by revision 9fb9699.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants