Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-17608

Gossip tests failing with the race detector enabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • v2.0.1
    • None
    • fabric-gossip
    • Hide
      go test -count 1 -race ./gossip/...

      I did this on 6 core linux laptop with go 1.14 on current master.
      Show
      go test -count 1 -race ./gossip/... I did this on 6 core linux laptop with go 1.14 on current master.

    Description

      go test -count 1 -race ./gossip/...

      ==================
      WARNING: DATA RACE
      Read at 0x00c000032bd0 by goroutine 54:
        runtime.mapaccess2_faststr()
            /usr/local/go/src/runtime/map_faststr.go:107 +0x0
        github.com/hyperledger/fabric/gossip/gossip.(*naiveCryptoService).Expiration()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:123 +0x10b
        github.com/hyperledger/fabric/gossip/identity.(*identityMapperImpl).Put()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/identity/identity.go:113 +0xcf
        github.com/hyperledger/fabric/gossip/identity.NewIdentityMapper()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/identity/identity.go:82 +0x2f7
        github.com/hyperledger/fabric/gossip/gossip.New()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_impl.go:97 +0x837
        github.com/hyperledger/fabric/gossip/gossip.newGossipInstanceWithGrpcMcsMetrics()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:250 +0x892
        github.com/hyperledger/fabric/gossip/gossip.newGossipInstanceCreateGRPCWithMCSWithMetrics()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:318 +0xc6
        github.com/hyperledger/fabric/gossip/gossip.newGossipInstanceCreateGRPC()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:324 +0xfa
        github.com/hyperledger/fabric/gossip/gossip.TestNoMessagesSelfLoop()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:653 +0x23e
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Previous write at 0x00c000032bd0 by goroutine 61:
        runtime.mapassign_faststr()
            /usr/local/go/src/runtime/map_faststr.go:202 +0x0
        github.com/hyperledger/fabric/gossip/gossip.TestIdentityExpiration()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:1419 +0x4a1
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Goroutine 54 (running) created at:
        testing.(*T).Run()
            /usr/local/go/src/testing/testing.go:1043 +0x660
        testing.runTests.func1()
            /usr/local/go/src/testing/testing.go:1285 +0xa6
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
        testing.runTests()
            /usr/local/go/src/testing/testing.go:1283 +0x527
        testing.(*M).Run()
            /usr/local/go/src/testing/testing.go:1200 +0x2ff
        github.com/hyperledger/fabric/gossip/gossip.TestMain()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:46 +0xc0
        main.main()
            _testmain.go:100 +0x223
      
      Goroutine 61 (running) created at:
        testing.(*T).Run()
            /usr/local/go/src/testing/testing.go:1043 +0x660
        testing.runTests.func1()
            /usr/local/go/src/testing/testing.go:1285 +0xa6
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
        testing.runTests()
            /usr/local/go/src/testing/testing.go:1283 +0x527
        testing.(*M).Run()
            /usr/local/go/src/testing/testing.go:1200 +0x2ff
        github.com/hyperledger/fabric/gossip/gossip.TestMain()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/gossip/gossip_test.go:46 +0xc0
        main.main()
            _testmain.go:100 +0x223
      ==================
      --- FAIL: TestLeaveChannel (2.12s)
          testing.go:906: race detected during execution of test
      
      
      
      ==================
      WARNING: DATA RACE
      Write at 0x000001bc0a90 by goroutine 43:
        github.com/hyperledger/fabric/gossip/state.TestHaltChainProcessing.func4()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:771 +0x3a
        github.com/hyperledger/fabric/gossip/state.TestHaltChainProcessing()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:796 +0x1132
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Previous read at 0x000001bc0a90 by goroutine 48:
        github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).antiEntropy()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:591 +0xa2
      
      Goroutine 43 (running) created at:
        testing.(*T).Run()
            /usr/local/go/src/testing/testing.go:1043 +0x660
        testing.runTests.func1()
            /usr/local/go/src/testing/testing.go:1285 +0xa6
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
        testing.runTests()
            /usr/local/go/src/testing/testing.go:1283 +0x527
        testing.(*M).Run()
            /usr/local/go/src/testing/testing.go:1200 +0x2ff
        main.main()
            _testmain.go:92 +0x223
      
      Goroutine 48 (running) created at:
        github.com/hyperledger/fabric/gossip/state.NewGossipStateProvider()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:275 +0xe5e
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidatorWithMetrics()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:418 +0xa41
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidator()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:447 +0xea
        github.com/hyperledger/fabric/gossip/state.TestHaltChainProcessing()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:789 +0xd27
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      ==================
      --- FAIL: TestHaltChainProcessing (1.01s)
      
      RNING: DATA RACE
      Read at 0x00c00019c040 by goroutine 172:
        github.com/hyperledger/fabric/gossip/state.(*mockCommitter).DoesPvtDataInfoExistInLedger()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:228 +0xb5
        github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:175 +0x6d1
        github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:785 +0xcc
        github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:575 +0x7f7
      
      Previous write at 0x00c00019c040 by goroutine 42:
        github.com/hyperledger/fabric/gossip/state.TestBlockingEnqueue()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:719 +0xf64
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Goroutine 172 (running) created at:
        github.com/hyperledger/fabric/gossip/state.NewGossipStateProvider()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:272 +0xdaa
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidatorWithMetrics()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:418 +0xa41
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidator()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:447 +0xea
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossip()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:336 +0xa15
        github.com/hyperledger/fabric/gossip/state.newPeerNode()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:453 +0x955
        github.com/hyperledger/fabric/gossip/state.TestBlockingEnqueue()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:674 +0x936
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Goroutine 42 (running) created at:
        testing.(*T).Run()
            /usr/local/go/src/testing/testing.go:1043 +0x660
        testing.runTests.func1()
            /usr/local/go/src/testing/testing.go:1285 +0xa6
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
        testing.runTests()
            /usr/local/go/src/testing/testing.go:1283 +0x527
        testing.(*M).Run()
            /usr/local/go/src/testing/testing.go:1200 +0x2ff
        main.main()
            _testmain.go:92 +0x223
      ==================
      ==================
      WARNING: DATA RACE
      Write at 0x00c0001e8368 by goroutine 172:
        sync/atomic.CompareAndSwapInt32()
            /usr/local/go/src/runtime/race_amd64.s:293 +0xb
        sync.(*Mutex).Lock()
            /usr/local/go/src/sync/mutex.go:74 +0x49
        github.com/hyperledger/fabric/vendor/github.com/stretchr/testify/mock.(*Mock).MethodCalled()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/vendor/github.com/stretchr/testify/mock/mock.go:342 +0x61
        github.com/hyperledger/fabric/vendor/github.com/stretchr/testify/mock.(*Mock).Called()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/vendor/github.com/stretchr/testify/mock/mock.go:334 +0x1e4
        github.com/hyperledger/fabric/gossip/state.(*mockCommitter).DoesPvtDataInfoExistInLedger()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:228 +0xe5
        github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:175 +0x6d1
        github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:785 +0xcc
        github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:575 +0x7f7
      
      Previous write at 0x00c0001e8368 by goroutine 42:
        github.com/hyperledger/fabric/gossip/state.TestBlockingEnqueue()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:712 +0xb31
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Goroutine 172 (running) created at:
        github.com/hyperledger/fabric/gossip/state.NewGossipStateProvider()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state.go:272 +0xdaa
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidatorWithMetrics()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:418 +0xa41
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossipWithValidator()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:447 +0xea
        github.com/hyperledger/fabric/gossip/state.newPeerNodeWithGossip()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:336 +0xa15
        github.com/hyperledger/fabric/gossip/state.newPeerNode()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:453 +0x955
        github.com/hyperledger/fabric/gossip/state.TestBlockingEnqueue()
            /home/sykesm/workspace/fabric/src/github.com/hyperledger/fabric/gossip/state/state_test.go:674 +0x936
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
      
      Goroutine 42 (running) created at:
        testing.(*T).Run()
            /usr/local/go/src/testing/testing.go:1043 +0x660
        testing.runTests.func1()
            /usr/local/go/src/testing/testing.go:1285 +0xa6
        testing.tRunner()
            /usr/local/go/src/testing/testing.go:992 +0x1eb
        testing.runTests()
            /usr/local/go/src/testing/testing.go:1283 +0x527
        testing.(*M).Run()
            /usr/local/go/src/testing/testing.go:1200 +0x2ff
        main.main()
            _testmain.go:92 +0x223
      ==================
      --- FAIL: TestOverPopulation (0.16s)
          testing.go:906: race detected during execution of test
      

      Attachments

        Issue Links

          Activity

            People

              yacovm Yacov Manevich
              sykesm Matthew Sykes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: