Skip to content

data race detected #8923

Closed
Closed
@alessio

Description

@alessio

Data races were detected in 2 packages:

$ go test -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock' ./x/auth/client/...
ok  	github.com/cosmos/cosmos-sdk/x/auth/client	0.513s
ok  	github.com/cosmos/cosmos-sdk/x/auth/client/cli	91.857s
==================
WARNING: DATA RACE
Write at 0x00c00011ea80 by goroutine 179:
  container/list.(*List).move()
      /usr/local/go/src/container/list/list.go:128 +0x39d
  container/list.(*List).MoveToFront()
      /usr/local/go/src/container/list/list.go:188 +0x23f
  github.com/hashicorp/golang-lru/simplelru.(*LRU).Get()
      /home/alessio/go/pkg/mod/github.com/hashicorp/golang-lru@v0.5.4/simplelru/lru.go:75 +0xed
  github.com/cosmos/cosmos-sdk/types.AccAddress.String()
      /home/alessio/work/cosmos-sdk/types/address.go:272 +0x16f
  github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseSendKeeper.SendCoins()
      /home/alessio/work/cosmos-sdk/x/bank/keeper/send.go:137 +0xcd
  github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper.SendCoinsFromAccountToModule()
      /home/alessio/work/cosmos-sdk/x/bank/keeper/keeper.go:314 +0x213
  github.com/cosmos/cosmos-sdk/x/bank/keeper.(*BaseKeeper).SendCoinsFromAccountToModule()
      <autogenerated>:1 +0x1ba
  github.com/cosmos/cosmos-sdk/x/auth/ante.DeductFees()
      /home/alessio/work/cosmos-sdk/x/auth/ante/fee.go:107 +0x177
  github.com/cosmos/cosmos-sdk/x/feegrant/ante.DeductGrantedFeeDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/feegrant/ante/fee.go:76 +0x3d0
  github.com/cosmos/cosmos-sdk/x/feegrant/ante.(*DeductGrantedFeeDecorator).AnteHandle()
      <autogenerated>:1 +0x19e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.ConsumeTxSizeGasDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/basic.go:142 +0x2bb
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*ConsumeTxSizeGasDecorator).AnteHandle()
      <autogenerated>:1 +0x184
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.ValidateMemoDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/basic.go:66 +0x38c
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*ValidateMemoDecorator).AnteHandle()
      <autogenerated>:1 +0x184
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.TxTimeoutHeightDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/basic.go:199 +0x18c
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*TxTimeoutHeightDecorator).AnteHandle()
      <autogenerated>:1 +0x11e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.ValidateBasicDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/basic.go:34 +0x1cc
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*ValidateBasicDecorator).AnteHandle()
      <autogenerated>:1 +0x11e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.MempoolFeeDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/fee.go:54 +0x1db
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*MempoolFeeDecorator).AnteHandle()
      <autogenerated>:1 +0x11e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.RejectExtensionOptionsDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/ext.go:35 +0x12d
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*RejectExtensionOptionsDecorator).AnteHandle()
      <autogenerated>:1 +0x11e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle()
      /home/alessio/work/cosmos-sdk/x/auth/ante/setup.go:64 +0x58c
  github.com/cosmos/cosmos-sdk/x/auth/ante.(*SetUpContextDecorator).AnteHandle()
      <autogenerated>:1 +0x11e
  github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1()
      /home/alessio/work/cosmos-sdk/types/handler.go:40 +0x1d7
  github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx()
      /home/alessio/work/cosmos-sdk/baseapp/baseapp.go:632 +0xa8a
  github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).CheckTx()
      /home/alessio/work/cosmos-sdk/baseapp/abci.go:229 +0x205
  github.com/cosmos/cosmos-sdk/simapp.(*SimApp).CheckTx()
      <autogenerated>:1 +0xde
  github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/abci/client/local_client.go:98 +0x148
  github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/proxy/app_conn.go:126 +0x7a
  github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/mempool/clist_mempool.go:288 +0x48e
  github.com/tendermint/tendermint/mempool.(*Reactor).Receive()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/mempool/reactor.go:183 +0x432
  github.com/tendermint/tendermint/p2p.createMConnection.func1()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/peer.go:390 +0x383
  github.com/tendermint/tendermint/p2p/conn.(*MConnection).recvRoutine()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/conn/connection.go:646 +0x82c

Previous read at 0x00c00011ea80 by goroutine 109:
  [failed to restore the stack]

Goroutine 179 (running) created at:
  github.com/tendermint/tendermint/p2p/conn.(*MConnection).OnStart()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/conn/connection.go:231 +0x36b
  github.com/tendermint/tendermint/libs/service.(*BaseService).Start()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/libs/service/service.go:140 +0x55e
  github.com/tendermint/tendermint/p2p.(*peer).OnStart()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/peer.go:182 +0x58
  github.com/tendermint/tendermint/libs/service.(*BaseService).Start()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/libs/service/service.go:140 +0x55e
  github.com/tendermint/tendermint/p2p.(*peer).Start()
      <autogenerated>:1 +0x44
  github.com/tendermint/tendermint/p2p.(*Switch).addPeer()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/switch.go:815 +0x32a
  github.com/tendermint/tendermint/p2p.(*Switch).addOutboundPeerWithConfig()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/switch.go:751 +0x72a
  github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/switch.go:544 +0x1ba
  github.com/tendermint/tendermint/p2p.(*Switch).dialPeersAsync.func1()
      /home/alessio/go/pkg/mod/github.com/tendermint/tendermint@v0.34.8/p2p/switch.go:519 +0x2c6

Goroutine 109 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1239 +0x5d7
  github.com/stretchr/testify/suite.(*Suite).Run()
      /home/alessio/go/pkg/mod/github.com/stretchr/testify@v1.7.0/suite/suite.go:75 +0x17c
  github.com/cosmos/cosmos-sdk/x/auth/client/rest_test.(*IntegrationTestSuite).TestMultipleSyncBroadcastTxRequests()
      /home/alessio/work/cosmos-sdk/x/auth/client/rest/rest_test.go:291 +0x31a
  runtime.call16()
      /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:337 +0xd8
  github.com/stretchr/testify/suite.Run.func1()
      /home/alessio/go/pkg/mod/github.com/stretchr/testify@v1.7.0/suite/suite.go:158 +0x391
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1194 +0x202
==================
--- FAIL: TestIntegrationTestSuite (38.73s)
    rest_test.go:45: setting up integration test suite
    network.go:171: acquiring test network lock
    network.go:176: created temporary directory: /tmp/TestIntegrationTestSuite3233055087/001/chain-u8JTXu503158573
    network.go:185: preparing test network...
    network.go:372: starting test network...
    network.go:377: started test network
    --- FAIL: TestIntegrationTestSuite/TestMultipleSyncBroadcastTxRequests (0.56s)
        --- FAIL: TestIntegrationTestSuite/TestMultipleSyncBroadcastTxRequests/Case_Second_tx_(correct_sequence) (0.19s)
            testing.go:1093: race detected during execution of test
        testing.go:1093: race detected during execution of test
    rest_test.go:83: tearing down integration test suite
    network.go:464: cleaning up test network...
    network.go:487: finished cleaning up test network
    network.go:461: released test network lock
    testing.go:1093: race detected during execution of test
FAIL
FAIL	github.com/cosmos/cosmos-sdk/x/auth/client/rest	39.203s
?   	github.com/cosmos/cosmos-sdk/x/auth/client/testutil	[no test files]
FAIL
alessio@phoenix:~/work/cosmos-sdk$ go test -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock' ./simapp/simd/cmd/...
Error: failed to parse log level (main:info,state:info,statesync:info,*:error): Unknown Level String: 'main:info,state:info,statesync:info,*:error', defaulting to NoLevel
Usage:
  simd init [moniker] [flags]

Flags:
      --chain-id string   genesis file chain-id, if left blank will be randomly created
  -h, --help              help for init
  -o, --overwrite         overwrite the genesis.json file
      --recover           provide seed phrase to recover existing key instead of creating

Global Flags:
      --home string         directory for config and data (default "/home/alessio/.simapp")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --trace               print out full stack trace on errors

--- FAIL: TestInitCmd (0.02s)
    cmd_test.go:23: 
        	Error Trace:	cmd_test.go:23
        	Error:      	Received unexpected error:
        	            	failed to parse log level (main:info,state:info,statesync:info,*:error): Unknown Level String: 'main:info,state:info,statesync:info,*:error', defaulting to NoLevel
        	Test:       	TestInitCmd
{"app_message":{"genutil":{"gen_txs":[]}},"chain_id":"test-chain-gbuhs1","gentxs_dir":"","moniker":"appnode-test","node_id":"0a0714b7c48cb0dd7867299ed4b179d3de6bb898"}
Error: failed to get address from Keybase: The specified item could not be found in the keyring
Usage:
  add-genesis-account [address_or_key_name] [coin][,[coin]] [flags]

Flags:
      --height int               Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help                     help for add-genesis-account
      --home string              The application home directory (default "/tmp/TestAddGenesisAccountCmd_invalid_address1926786926/001")
      --keyring-backend string   Select keyring's backend (os|file|kwallet|pass|test) (default "os")
      --node string              <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
  -o, --output string            Output format (text|json) (default "text")
      --vesting-amount string    amount of coins for vesting accounts
      --vesting-end-time int     schedule end time (unix epoch) for vesting accounts
      --vesting-start-time int   schedule start time (unix epoch) for vesting accounts

{"app_message":{"genutil":{"gen_txs":[]}},"chain_id":"test-chain-dQceaZ","gentxs_dir":"","moniker":"appnode-test","node_id":"6f590ed0f678195110190d41d190d9acd6a19ff3"}
{"app_message":{"genutil":{"gen_txs":[]}},"chain_id":"test-chain-kvWa6f","gentxs_dir":"","moniker":"appnode-test","node_id":"4f25302944daa95b763047061ba7bc54400a530d"}
FAIL
FAIL	github.com/cosmos/cosmos-sdk/simapp/simd/cmd	0.480s
FAIL

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions