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

Race condition in muxer when running server_test.go #586

Open
rakshasa opened this issue Apr 16, 2024 · 0 comments
Open

Race condition in muxer when running server_test.go #586

rakshasa opened this issue Apr 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rakshasa
Copy link
Contributor

==================
WARNING: DATA RACE
Write at 0x00c0001f2268 by goroutine 181:
  runtime.racewrite()
      <autogenerated>:1 +0x1e
  github.com/blinklabs-io/gouroboros/muxer.New.func1()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/muxer/muxer.go:92 +0x7c

Previous read at 0x00c0001f2268 by goroutine 173:
  runtime.raceread()
      <autogenerated>:1 +0x1e
  github.com/blinklabs-io/gouroboros/muxer.(*Muxer).RegisterProtocol()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/muxer/muxer.go:157 +0x327
  github.com/blinklabs-io/gouroboros.(*Connection).setupConnection.(*Protocol).Start.func7()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/protocol/protocol.go:122 +0xcb
  sync.(*Once).doSlow()
      /usr/local/go/src/sync/once.go:74 +0xf0
  sync.(*Once).Do()
      /usr/local/go/src/sync/once.go:65 +0x44
  github.com/blinklabs-io/gouroboros/protocol.(*Protocol).Start()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/protocol/protocol.go:116 +0xa8e
  github.com/blinklabs-io/gouroboros.(*Connection).setupConnection()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:327 +0x9d0
  github.com/blinklabs-io/gouroboros.NewConnection()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:112 +0x266
  github.com/blinklabs-io/gouroboros.New()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:121 +0x5c7
  github.com/blinklabs-io/gouroboros/protocol/handshake_test.TestServerBasicHandshake()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/protocol/handshake/server_test.go:59 +0x550
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x44

Goroutine 181 (running) created at:
  github.com/blinklabs-io/gouroboros/muxer.New()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/muxer/muxer.go:85 +0x33c
  github.com/blinklabs-io/gouroboros.(*Connection).setupConnection()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:257 +0x20b
  github.com/blinklabs-io/gouroboros.NewConnection()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:112 +0x266
  github.com/blinklabs-io/gouroboros.New()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/connection.go:121 +0x5c7
  github.com/blinklabs-io/gouroboros/protocol/handshake_test.TestServerBasicHandshake()
      /Users/rakshasa/projects/cardano/gouroboros/gouroboros/protocol/handshake/server_test.go:59 +0x550
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x44

Goroutine 173 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1742 +0x825
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:2161 +0x85
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.runTests()
      /usr/local/go/src/testing/testing.go:2159 +0x8be
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:2027 +0xf17
  main.main()
      _testmain.go:67 +0x2bd
==================
    server_test.go:65: unexpected error when creating Ouroboros object: EOF
    testing.go:1398: race detected during execution of test
--- FAIL: TestServerBasicHandshake (0.00s)

This triggered once on commit 5ac94a5 and never saw it again.

@wolf31o2 wolf31o2 added the bug Something isn't working label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants