Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Multiple data races in HC #236

Closed
dnkolegov opened this issue Aug 17, 2022 · 6 comments
Closed

Multiple data races in HC #236

dnkolegov opened this issue Aug 17, 2022 · 6 comments
Assignees

Comments

@dnkolegov
Copy link
Collaborator

dnkolegov commented Aug 17, 2022

Multiple data races found during tests

WARNING: DATA RACE
Read at 0x00c00295ad28 by goroutine 905:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).getAPI()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:801 +0x230
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSubnetAPI()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:825 +0x54
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:833 +0x68
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:309 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c00295ad28 by goroutine 1078:
  [failed to restore the stack]

Goroutine 905 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:130 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:628 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:577 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1078 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================

---
WARNING: DATA RACE
Read at 0x00c00029ad58 by goroutine 905:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).StateGetActor()
      <autogenerated>:1 +0x5c
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:838 +0x140
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:309 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c00029ad58 by goroutine 1078:
  [failed to restore the stack]

Goroutine 905 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:130 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:628 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:577 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1078 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
2022-08-17T22:00:52.771+0300	INFO	subnetMgr	submgr/manager.go:329	Listening to SCA events in subnet	{"subnetID": "/root/t01003"}
==================
WARNING: DATA RACE
Read at 0x00c00029a8e8 by goroutine 905:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).ChainReadObj()
      <autogenerated>:1 +0x50
  github.com/filecoin-project/lotus/blockstore.(*apiBlockstore).Get()
      /Users/alpha/Projects/eudico/blockstore/api.go:37 +0x6c
  github.com/filecoin-project/lotus/blockstore.(*adaptedBlockstore).Get()
      <autogenerated>:1 +0x74
  github.com/ipfs/go-ipld-cbor.(*BasicIpldStore).Get()
      /Users/alpha/go/pkg/mod/github.com/ipfs/go-ipld-cbor@v0.0.6/store.go:63 +0x180
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:844 +0x400
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:309 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c00029a8e8 by goroutine 1078:
  [failed to restore the stack]

Goroutine 905 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:130 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:628 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:577 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1078 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
@dnkolegov dnkolegov assigned dnkolegov and adlrocha and unassigned dnkolegov Aug 17, 2022
@dnkolegov dnkolegov changed the title Multiple data races Multiple data races in HC Aug 17, 2022
@adlrocha
Copy link
Collaborator

adlrocha commented Aug 25, 2022

I think this data race appears when concurrently accessing the API for a subnet. I think your fix here solves part of it. The other part is reviewing the purpose of this lock. I think in many cases the lock you introduced and this lock are redundant. Initially its purpose was to lock the manager when something had to be written, but now that we have the low-level subnet lock I don't think this one is necessary anymore.

Do you mind having a look at it before merging the reconfiguration PR? We can look at it together sync if needed.

@dnkolegov
Copy link
Collaborator Author

After this commit I haven't seen new data races.

@dnkolegov
Copy link
Collaborator Author

After this commit I haven't seen new data races.

Unfortunately, that is not true - #240 (comment)

@dnkolegov
Copy link
Collaborator Author

It will be fixed via these commits:

@dnkolegov
Copy link
Collaborator Author

Reproduced after switching to Go 1.18.

==================
WARNING: DATA RACE
Read at 0x00c002c8c0a8 by goroutine 946:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).getAPI()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:813 +0x1d4
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSubnetAPI()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:840 +0x54
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:848 +0x68
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c002c8c0a8 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
==================
WARNING: DATA RACE
Read at 0x00c00397c558 by goroutine 946:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).StateGetActor()
      <autogenerated>:1 +0x5c
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:853 +0x140
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c00397c558 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
==================
WARNING: DATA RACE
Read at 0x00c002179fb8 by goroutine 946:
  github.com/filecoin-project/lotus/node/impl/full.(*StateModule).StateGetActor()
      /Users/alpha/Projects/eudico/node/impl/full/state.go:436 +0x54
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).StateGetActor()
      <autogenerated>:1 +0x8c
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:853 +0x140
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c002179fb8 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
==================
WARNING: DATA RACE
Read at 0x00c002179fb0 by goroutine 946:
  github.com/filecoin-project/lotus/node/impl/full.(*StateModule).StateGetActor()
      /Users/alpha/Projects/eudico/node/impl/full/state.go:440 +0x12c
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).StateGetActor()
      <autogenerated>:1 +0x8c
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:853 +0x140
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c002179fb0 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
==================
WARNING: DATA RACE
Read at 0x00c00397c0e8 by goroutine 946:
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).ChainReadObj()
      <autogenerated>:1 +0x50
  github.com/filecoin-project/lotus/blockstore.(*apiBlockstore).Get()
      /Users/alpha/Projects/eudico/blockstore/api.go:37 +0x6c
  github.com/filecoin-project/lotus/blockstore.(*adaptedBlockstore).Get()
      <autogenerated>:1 +0x74
  github.com/ipfs/go-ipld-cbor.(*BasicIpldStore).Get()
      /Users/alpha/go/pkg/mod/github.com/ipfs/go-ipld-cbor@v0.0.6/store.go:63 +0x180
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:859 +0x400
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c00397c0e8 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================
==================
WARNING: DATA RACE
Read at 0x00c004946258 by goroutine 946:
  github.com/filecoin-project/lotus/node/impl/full.(*ChainModule).ChainReadObj()
      /Users/alpha/Projects/eudico/node/impl/full/chain.go:256 +0x48
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*API).ChainReadObj()
      <autogenerated>:1 +0x78
  github.com/filecoin-project/lotus/blockstore.(*apiBlockstore).Get()
      /Users/alpha/Projects/eudico/blockstore/api.go:37 +0x6c
  github.com/filecoin-project/lotus/blockstore.(*adaptedBlockstore).Get()
      <autogenerated>:1 +0x74
  github.com/ipfs/go-ipld-cbor.(*BasicIpldStore).Get()
      /Users/alpha/go/pkg/mod/github.com/ipfs/go-ipld-cbor@v0.0.6/store.go:63 +0x180
  github.com/filecoin-project/lotus/chain/consensus/hierarchical/subnet/submgr.(*Service).GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/hierarchical/subnet/submgr/manager.go:859 +0x400
  github.com/filecoin-project/lotus/chain/consensus/common/crossmsg.GetSCAState()
      /Users/alpha/Projects/eudico/chain/consensus/common/crossmsg/crossmsg.go:250 +0x694
  github.com/filecoin-project/lotus/chain/consensus/common.checkBlockMessages()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:305 +0xfdc
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig.func1()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:112 +0x128
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Previous write at 0x00c004946258 by goroutine 1089:
  [failed to restore the stack]

Goroutine 946 (running) created at:
  github.com/Gurpartap/async.Err()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:27 +0x158
  github.com/filecoin-project/lotus/chain/consensus/common.CheckMsgsWithoutBlockSig()
      /Users/alpha/Projects/eudico/chain/consensus/common/cns_validations.go:107 +0x2b0
  github.com/filecoin-project/lotus/chain/consensus/mir.(*Mir).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/consensus/mir/consensus.go:115 +0x6a0
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock()
      /Users/alpha/Projects/eudico/chain/sync.go:627 +0x214
  github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1()
      /Users/alpha/Projects/eudico/chain/sync.go:576 +0x74
  github.com/Gurpartap/async.Err.func1()
      /Users/alpha/go/pkg/mod/github.com/!gurpartap/async@v0.0.0-20180927173644-4f7f499dd9ee/error.go:29 +0x74

Goroutine 1089 (running) created at:
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleCall()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:424 +0x5f8
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleFrame()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:443 +0x2a0
  github.com/filecoin-project/go-jsonrpc.(*wsConn).handleWsConn()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/websocket.go:614 +0x8a0
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).handleWS()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:73 +0x440
  github.com/filecoin-project/go-jsonrpc.(*RPCServer).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/filecoin-project/go-jsonrpc@v0.1.5/server.go:87 +0xf0
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/alpha/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x2a0
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:2916 +0x6cc
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:1966 +0x8e0
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.18.2/libexec/src/net/http/server.go:3071 +0x50
==================

@dnkolegov
Copy link
Collaborator Author

dnkolegov commented Sep 2, 2022

Fixed another bug - 6fe14f2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants