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

TestStaticRelays is racy #1382

Closed
marten-seemann opened this issue Apr 10, 2022 · 0 comments · Fixed by #1383
Closed

TestStaticRelays is racy #1382

marten-seemann opened this issue Apr 10, 2022 · 0 comments · Fixed by #1383
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@marten-seemann
Copy link
Contributor

=== RUN   TestStaticRelays
  ==================
  WARNING: DATA RACE
  Read at 0x00c00242f8c0 by goroutine 118:
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).handleNewCandidate()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:285 +0xea
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).background()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:139 +0x9e4
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).Start.func1()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:537 +0x90
  
  Previous write at 0x00c00242f8c0 by goroutine 28:
    runtime.mapassign_faststr()
        /opt/hostedtoolcache/go/1.16.15/x64/src/runtime/map_faststr.go:202 +0x0
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).handleNewNode()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:[220](https://github.com/libp2p/go-libp2p/runs/5962063510?check_suite_focus=true#step:9:220) +0x684
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).findNodes.func1()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:180 +0x109
  
  Goroutine 118 (running) created at:
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).Start()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:535 +0x23d
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*AutoRelay).background()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/autorelay.go:103 +0x3d2
    github.com/libp2p/go-libp2p/p2p/host/autorelay.NewAutoRelay.func1()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/autorelay.go:59 +0x71
  
  Goroutine 28 (finished) created at:
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).findNodes()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:178 +0x5da
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).background.func1()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:101 +0x90
  ==================
      testing.go:1102: race detected during execution of test
  --- FAIL: TestStaticRelays (2.50s)
@marten-seemann marten-seemann added the kind/bug A bug in existing code (including security flaws) label Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant