PlatONnetwork / PlatON-Go

Golang implementation of the PlatON protocol
GNU Lesser General Public License v3.0
450 stars 144 forks source link

Panic occurs in fast mode synchronization #375

Closed shinnng closed 4 years ago

shinnng commented 4 years ago

Non-consensus node connect consensus node, and use fast mode to synchronize blocks, procedures panic

error

Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml INFO [08-26|14:59:26.151|x/plugin/staking_plugin.go:3228] Call IsCandidateNode, the nodeId is not a Epoch validaotor nodeId=7edebd4a86bf2a21842e010d9c2b83860e41cd8f5ae96e1439990ba830bf13f9600173e429861a0e8927cfdef8164f267692d3a42c86a991a9ed1a353b4ab591 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xba218f]

goroutine 723 [running]: github.com/PlatONnetwork/PlatON-Go/core.(HeaderChain).WriteHeader(0xc0002d6a80, 0xc013009680, 0xc0001fc288, 0xf59a094a2d7a7322, 0x18f02bf3acf2d0a) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/core/headerchain.go:166 +0x4bf github.com/PlatONnetwork/PlatON-Go/core.(BlockChain).InsertHeaderChain.func1(0xc013009680, 0x0, 0x0) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/core/blockchain.go:1449 +0x8b github.com/PlatONnetwork/PlatON-Go/core.(HeaderChain).InsertHeaderChain(0xc0002d6a80, 0xc0118ed038, 0x1, 0x1, 0xc012ca7e80, 0xbf50feb388b46151, 0xf906f2430, 0x21e89c0, 0xc02974bbe0, 0xb8ac3d, ...) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/core/headerchain.go:265 +0x167 github.com/PlatONnetwork/PlatON-Go/core.(BlockChain).InsertHeaderChain(0xc0001fc000, 0xc0118ed038, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/core/blockchain.go:1453 +0x1ef github.com/PlatONnetwork/PlatON-Go/eth/downloader.(BlockChainWrapper).InsertHeaderChain(0xc0026c42c0, 0xc0118ed038, 0x1, 0x1, 0x1, 0x91, 0x0, 0x8e) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/eth/downloader/blockchain_wrapper.go:40 +0x5b github.com/PlatONnetwork/PlatON-Go/eth/downloader.(Downloader).processHeaders(0xc0026aa3c0, 0x8f, 0x32, 0xc0280f52c0, 0x0, 0x0) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/eth/downloader/downloader.go:1496 +0x622 github.com/PlatONnetwork/PlatON-Go/eth/downloader.(Downloader).syncWithPeer.func6(0x8, 0x11f1438) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/eth/downloader/downloader.go:496 +0x48 github.com/PlatONnetwork/PlatON-Go/eth/downloader.(Downloader).spawnSync.func1(0xc0026aa3c0, 0xc029f252c0, 0xc029f8eea0) /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/eth/downloader/downloader.go:704 +0x59 created by github.com/PlatONnetwork/PlatON-Go/eth/downloader.(*Downloader).spawnSync /home/platon/Jenkins/jenkins/workspace/PlatON/Build_Ubuntu/build/_workspace/src/github.com/PlatONnetwork/PlatON-Go/eth/downloader/downloader.go:704 +0xaf

shinnng commented 4 years ago

The issue has been resolved, please use the latest version.