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

Comments

Projects
None yet
4 participants
@dvyukov
Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2012

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

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2012

Comment 3:

So noted.
@davecheney

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2012

Comment 4:

This issue was closed by revision be0d84e.

Status changed to Fixed.

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2012

Comment 5:

This issue was closed by revision 5b425cc.

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2012

Comment 6:

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

Status changed to Started.

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2012

Comment 7:

This issue was closed by revision 9fb9699.

Status changed to Fixed.

@dvyukov dvyukov added fixed labels Dec 5, 2012

@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.
You can’t perform that action at this time.