BuildOnViction/tomochain-v1

concurrent map writes on dryrunCaches

thanhnguyennguyen opened this issue · 2 comments

fatal error: concurrent map writes

goroutine 84 [running]:
runtime.throw(0x1138064, 0x15)
        /usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc0025e4dd0 sp=0xc0025e4da0 pc=0x4430b2
runtime.mapdelete(0xf988e0, 0xc0000d1530, 0xc0025e4e70)
        /usr/local/go/src/runtime/map.go:708 +0x445 fp=0xc0025e4e38 sp=0xc0025e4dd0 pc=0x423dd5
github.com/ethereum/go-ethereum/tomox.(*BatchDatabase).InitDryRunMode(0xc0000e8420, 0x3037302b20353631, 0x3d6d2037302b2030, 0x362e32323338322b, 0x3431353933303935)
        /home/nguyen/go/src/github.com/ethereum/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/tomox/batchdb.go:189 +0x12c fp=0xc0025e4ec8 sp=0xc0025e4e38 pc=0xa6f65c
github.com/ethereum/go-ethereum/tomox.(*TomoX).ProcessOrderPending(0xc0000f8120, 0x1152bfe, 0x1e, 0x4)
        /home/nguyen/go/src/github.com/ethereum/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/tomox/tomox.go:817 +0x178 fp=0xc0025e5618 sp=0xc0025e4ec8 pc=0xaa0788
github.com/ethereum/go-ethereum/miner.(*worker).commitNewWork(0xc00017e780)
        /home/nguyen/go/src/github.com/ethereum/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/miner/worker.go:617 +0x1c28 fp=0xc0025e5d90 sp=0xc0025e5618 pc=0xbe88d8
github.com/ethereum/go-ethereum/miner.(*worker).update(0xc00017e780)
        /home/nguyen/go/src/github.com/ethereum/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/miner/worker.go:292 +0x72d fp=0xc0025e5fd8 sp=0xc0025e5d90 pc=0xbe523d
runtime.goexit()

I forgot to use sync.RWMutex in function InitDryRunMode

close as merging #699