neoneo-go/pkg/core/native
Roman Khimov bd400dfe20 native: copy contract on update
It can be a pointer to cached data:

2021-07-07T20:05:24.8508647Z ==================
2021-07-07T20:05:24.8509294Z WARNING: DATA RACE
2021-07-07T20:05:24.8510243Z Write at 0x00c000142cc8 by goroutine 51:
2021-07-07T20:05:24.8511350Z   github.com/nspcc-dev/neo-go/pkg/core/native.(*Management).Update()
2021-07-07T20:05:24.8529622Z       /home/runner/work/neo-go/neo-go/pkg/core/native/management.go:335 +0x70a
2021-07-07T20:05:24.8531266Z   github.com/nspcc-dev/neo-go/pkg/core/native.(*Management).updateWithData()
2021-07-07T20:05:24.8532544Z       /home/runner/work/neo-go/neo-go/pkg/core/native/management.go:316 +0x1e9
2021-07-07T20:05:24.8533726Z   github.com/nspcc-dev/neo-go/pkg/core/native.(*Management).update()
2021-07-07T20:05:24.8534928Z       /home/runner/work/neo-go/neo-go/pkg/core/native/management.go:303 +0x111
2021-07-07T20:05:24.8536123Z   github.com/nspcc-dev/neo-go/pkg/core/native.(*Management).update-fm()
2021-07-07T20:05:24.8537389Z       /home/runner/work/neo-go/neo-go/pkg/core/native/management.go:302 +0x34
2021-07-07T20:05:24.8538462Z   github.com/nspcc-dev/neo-go/pkg/core/native.Call()
2021-07-07T20:05:24.8539565Z       /home/runner/work/neo-go/neo-go/pkg/core/native/interop.go:54 +0x90c
2021-07-07T20:05:24.8540751Z   github.com/nspcc-dev/neo-go/pkg/core/interop.(*Context).SyscallHandler()
2021-07-07T20:05:24.8542177Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/context.go:262 +0x216
2021-07-07T20:05:24.8543328Z   github.com/nspcc-dev/neo-go/pkg/core/interop.(*Context).SyscallHandler-fm()
2021-07-07T20:05:24.8544586Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/context.go:250 +0x53
2021-07-07T20:05:24.8545648Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).execute()
2021-07-07T20:05:24.8546635Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:1312 +0xb2d5
2021-07-07T20:05:24.8547632Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).Step()
2021-07-07T20:05:24.8548640Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:416 +0x1f2
2021-07-07T20:05:24.8549836Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).Run()
2021-07-07T20:05:24.8550852Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:393 +0x195
2021-07-07T20:05:24.8551989Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).runScriptInVM()
2021-07-07T20:05:24.8553174Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:1326 +0x7eb
2021-07-07T20:05:24.8554345Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).invokeFunction()
2021-07-07T20:05:24.8555560Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:1219 +0x50c
2021-07-07T20:05:24.8556616Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).handleIn()
2021-07-07T20:05:24.8557823Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:345 +0xecb
2021-07-07T20:05:24.8558987Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).handleRequest()
2021-07-07T20:05:24.8560356Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:315 +0x364
2021-07-07T20:05:24.8561599Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).handleHTTPRequest()
2021-07-07T20:05:24.8562976Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:309 +0xf9b
2021-07-07T20:05:24.8564208Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).handleHTTPRequest-fm()
2021-07-07T20:05:24.8565523Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:257 +0x64
2021-07-07T20:05:24.8566348Z   net/http.HandlerFunc.ServeHTTP()
2021-07-07T20:05:24.8567290Z       /opt/hostedtoolcache/go/1.15.13/x64/src/net/http/server.go:2042 +0x51
2021-07-07T20:05:24.8568185Z   net/http.serverHandler.ServeHTTP()
2021-07-07T20:05:24.8569130Z       /opt/hostedtoolcache/go/1.15.13/x64/src/net/http/server.go:2843 +0xca
2021-07-07T20:05:24.8569861Z   net/http.(*conn).serve()
2021-07-07T20:05:24.8570634Z       /opt/hostedtoolcache/go/1.15.13/x64/src/net/http/server.go:1925 +0x84c
2021-07-07T20:05:24.8571139Z
2021-07-07T20:05:24.8571639Z Previous read at 0x00c000142cc8 by goroutine 41:
2021-07-07T20:05:24.8572892Z   github.com/nspcc-dev/neo-go/pkg/core/interop/contract.callExFromNative()
2021-07-07T20:05:24.8574265Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/contract/call.go:101 +0x2d4
2021-07-07T20:05:24.8575581Z   github.com/nspcc-dev/neo-go/pkg/core/interop/contract.callInternal()
2021-07-07T20:05:24.8576951Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/contract/call.go:85 +0x1f5
2021-07-07T20:05:24.8578094Z   github.com/nspcc-dev/neo-go/pkg/core/interop/contract.Call()
2021-07-07T20:05:24.8579306Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/contract/call.go:69 +0x804
2021-07-07T20:05:24.8580514Z   github.com/nspcc-dev/neo-go/pkg/core/interop.(*Context).SyscallHandler()
2021-07-07T20:05:24.8581755Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/context.go:262 +0x216
2021-07-07T20:05:24.8582907Z   github.com/nspcc-dev/neo-go/pkg/core/interop.(*Context).SyscallHandler-fm()
2021-07-07T20:05:24.8584300Z       /home/runner/work/neo-go/neo-go/pkg/core/interop/context.go:250 +0x53
2021-07-07T20:05:24.8585422Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).execute()
2021-07-07T20:05:24.8586403Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:1312 +0xb2d5
2021-07-07T20:05:24.8590451Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).Step()
2021-07-07T20:05:24.8591549Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:416 +0x1f2
2021-07-07T20:05:24.8592466Z   github.com/nspcc-dev/neo-go/pkg/vm.(*VM).Run()
2021-07-07T20:05:24.8593550Z       /home/runner/work/neo-go/neo-go/pkg/vm/vm.go:393 +0x195
2021-07-07T20:05:24.8594531Z   github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).storeBlock()
2021-07-07T20:05:24.8595708Z       /home/runner/work/neo-go/neo-go/pkg/core/blockchain.go:717 +0x1694
2021-07-07T20:05:24.8596793Z   github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).AddBlock()
2021-07-07T20:05:24.8598142Z       /home/runner/work/neo-go/neo-go/pkg/core/blockchain.go:579 +0x544
2021-07-07T20:05:24.8599419Z   github.com/nspcc-dev/neo-go/pkg/consensus.(*service).processBlock()
2021-07-07T20:05:24.8601093Z       /home/runner/work/neo-go/neo-go/pkg/consensus/consensus.go:521 +0x141
2021-07-07T20:05:24.8602485Z   github.com/nspcc-dev/neo-go/pkg/consensus.(*service).processBlock-fm()
2021-07-07T20:05:24.8603809Z       /home/runner/work/neo-go/neo-go/pkg/consensus/consensus.go:517 +0x55
2021-07-07T20:05:24.8604910Z   github.com/nspcc-dev/dbft.(*DBFT).checkCommit()
2021-07-07T20:05:24.8606098Z       /home/runner/go/pkg/mod/github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/check.go:73 +0xd8a
2021-07-07T20:05:24.8607235Z   github.com/nspcc-dev/dbft.(*DBFT).checkPrepare()
2021-07-07T20:05:24.8608551Z       /home/runner/go/pkg/mod/github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/check.go:36 +0x677
2021-07-07T20:05:24.8609681Z   github.com/nspcc-dev/dbft.(*DBFT).sendPrepareRequest()
2021-07-07T20:05:24.8611016Z       /home/runner/go/pkg/mod/github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/send.go:42 +0x47c
2021-07-07T20:05:24.8612107Z   github.com/nspcc-dev/dbft.(*DBFT).OnTimeout()
2021-07-07T20:05:24.8613257Z       /home/runner/go/pkg/mod/github.com/nspcc-dev/dbft@v0.0.0-20210302103605-cc75991b7cfb/dbft.go:188 +0x68c
2021-07-07T20:05:24.8614499Z   github.com/nspcc-dev/neo-go/pkg/consensus.(*service).eventLoop()
2021-07-07T20:05:24.8615712Z       /home/runner/work/neo-go/neo-go/pkg/consensus/consensus.go:274 +0x17ed
2021-07-07T20:05:24.8616284Z
2021-07-07T20:05:24.8616757Z Goroutine 51 (running) created at:
2021-07-07T20:05:24.8617367Z   net/http.(*Server).Serve()
2021-07-07T20:05:24.8618159Z       /opt/hostedtoolcache/go/1.15.13/x64/src/net/http/server.go:2969 +0x5d3
2021-07-07T20:05:24.8619253Z   github.com/nspcc-dev/neo-go/pkg/rpc/server.(*Server).Start.func2()
2021-07-07T20:05:24.8620437Z       /home/runner/work/neo-go/neo-go/pkg/rpc/server/server.go:224 +0x85
2021-07-07T20:05:24.8620936Z
2021-07-07T20:05:24.8621405Z Goroutine 41 (running) created at:
2021-07-07T20:05:24.8622393Z   github.com/nspcc-dev/neo-go/pkg/consensus.(*service).Start()
2021-07-07T20:05:24.8623562Z       /home/runner/work/neo-go/neo-go/pkg/consensus/consensus.go:250 +0x17c
2021-07-07T20:05:24.8624682Z   github.com/nspcc-dev/neo-go/pkg/network.(*Server).tryStartServices()
2021-07-07T20:05:24.8626078Z       /home/runner/work/neo-go/neo-go/pkg/network/server.go:445 +0x2e1
2021-07-07T20:05:24.8627226Z   github.com/nspcc-dev/neo-go/pkg/network.(*Server).Start()
2021-07-07T20:05:24.8628333Z       /home/runner/work/neo-go/neo-go/pkg/network/server.go:268 +0x2af
2021-07-07T20:05:24.8628973Z ==================
2021-07-08 10:40:54 +03:00
..
nativenames core: remove native NNS 2021-05-17 22:22:07 +03:00
nativeprices core: move NotaryVerificationPrice to a separate package 2021-03-23 13:56:39 +03:00
noderoles core: move native node roles to a separate pkg 2021-03-23 13:56:34 +03:00
compatibility_test.go config: add NativeUpdateHistory 2021-03-15 12:35:14 +03:00
contract.go core: remove native NNS 2021-05-17 22:22:07 +03:00
crypto.go native: implement CryptoLib contract 2021-03-10 19:24:19 +03:00
crypto_test.go core: use Neo.Crypto.CheckSig for standard signature verification 2021-03-10 21:45:58 +03:00
designate.go native: emit Designation event on role update 2021-04-29 14:12:48 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
interop.go config: add NativeUpdateHistory 2021-03-15 12:35:14 +03:00
ledger.go *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
management.go native: copy contract on update 2021-07-08 10:40:54 +03:00
management_test.go *: fix all errcheck warnings in testing code 2021-05-12 21:45:12 +03:00
native_gas.go native: add refuel method to GAS contract 2021-04-29 18:26:34 +03:00
native_neo.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
native_neo_candidate.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
native_neo_test.go native: implement delegated voting 2020-08-06 20:39:13 +03:00
native_nep17.go native: fix typo in comments 2021-07-05 11:04:19 +03:00
nativenames_test.go *: fix some misspellings spotted by GoReportCard 2021-03-22 12:13:08 +03:00
neo_types.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
notary.go config: make MaxValidUntilBlockIncrement configurable 2021-05-17 13:43:03 +03:00
oracle.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
oracle_types.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
oracle_types_test.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
policy.go *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
std.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
std_test.go stackitem: remove Item/StackItem from function names 2021-07-06 19:56:23 +03:00
util.go *: fix whitespace errors 2021-05-12 22:51:41 +03:00