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

server: fix wireToAddrmgrNetAddress data race. #2758

Merged
merged 1 commit into from Oct 20, 2021

Conversation

dnldd
Copy link
Member

@dnldd dnldd commented Oct 12, 2021

This fixes a data race for the network address passed into wireToAddrmgrNetAddress.

==================
WARNING: DATA RACE
Write at 0x00c01cef1f18 by goroutine 99:
  github.com/decred/dcrd/peer/v3.(*Peer).readRemoteVersionMsg()
      /Users/dnldd/Work/dcrd/peer/peer.go:1809 +0x214
  github.com/decred/dcrd/peer/v3.(*Peer).negotiateOutboundProtocol()
      /Users/dnldd/Work/dcrd/peer/peer.go:1944 +0x74
  github.com/decred/dcrd/peer/v3.(*Peer).start.func1()
      /Users/dnldd/Work/dcrd/peer/peer.go:1956 +0x7c

Previous read at 0x00c01cef1f18 by goroutine 97:
  main.wireToAddrmgrNetAddress()
      /Users/dnldd/Work/dcrd/server.go:616 +0x630
  main.(*server).outboundPeerConnected()
      /Users/dnldd/Work/dcrd/server.go:2243 +0x5c0
  main.(*server).outboundPeerConnected-fm()
      /Users/dnldd/Work/dcrd/server.go:2229 +0x58

Goroutine 99 (running) created at:
  github.com/decred/dcrd/peer/v3.(*Peer).start()
      /Users/dnldd/Work/dcrd/peer/peer.go:1952 +0x11c
  github.com/decred/dcrd/peer/v3.(*Peer).AssociateConnection.func1()
      /Users/dnldd/Work/dcrd/peer/peer.go:2013 +0x30

Goroutine 97 (finished) created at:
  github.com/decred/dcrd/connmgr/v3.(*ConnManager).connHandler()
      /Users/dnldd/Work/dcrd/connmgr/connmanager.go:334 +0x1080
==================

@dnldd dnldd force-pushed the fix_wireToAddrmgrNetAddress_race branch from 4e62289 to e1fce91 Compare October 12, 2021 00:45
@davecgh davecgh added this to the 1.7.0 milestone Oct 12, 2021
peer/peer.go Outdated Show resolved Hide resolved
@dnldd dnldd force-pushed the fix_wireToAddrmgrNetAddress_race branch from e1fce91 to 3fcb437 Compare October 19, 2021 01:12
peer/peer.go Show resolved Hide resolved
@dnldd dnldd force-pushed the fix_wireToAddrmgrNetAddress_race branch 2 times, most recently from 8542082 to 96de1d5 Compare October 19, 2021 23:45
This fixes a data race for the network address passed into
wireToAddrmgrNetAddress.
@dnldd dnldd force-pushed the fix_wireToAddrmgrNetAddress_race branch from 96de1d5 to 9d314f3 Compare October 19, 2021 23:46
@davecgh davecgh merged commit 0076cea into decred:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants