truechain / truechain-engineering-code

Go implementation of TrueChain
GNU Lesser General Public License v3.0
100 stars 81 forks source link

runtime error: invalid memory address or nil pointer dereference #63

Closed hyangl closed 5 years ago

hyangl commented 5 years ago
> INFO [01-08|13:56:23.158] Timed out                                dur=999.960712ms height=763383 round=0 step=RoundStepNewHeight
INFO [01-08|13:56:23.158] enterNewRound(763383/0). Current: 763383/0/RoundStepNewHeight 
INFO [01-08|13:56:23.158] tryenterPropose(763383/0). Current: 763383/0/RoundStepNewRound 
ERROR[01-08|13:56:23.158] CONSENSUS FAILURE!!!                     err="runtime error: invalid memory address or nil pointer dereference"        stack="goroutine 131 [running]:\nruntime/debug.Stack(0xc425b6b348, 0xf78ba0, 0x1a251e0)\n\t/usr/lib/go-1.10/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).receiveRoutine.func2(0x1128b20, 0xc42b044a80)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:488 +0x57\npanic(0xf78ba0, 0x1a251e0)\n\t/usr/lib/go-1.10/src/runtime/panic.go:505 +0x229\ngithub.com/truechain/truechain-engineering-code/core/types.(*Block).NumberU64(...)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/core/types/block.go:337\ngithub.com/truechain/truechain-engineering-code/consensus/tbft/types.(*StateAgentImpl).MakeBlock(0xc4200a5b30, 0xc42b409201, 0x14, 0x14, 0x1, 0xc42b259bc0)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/types/priv_validator.go:392 +0x137\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).createProposalBlock(0xc42b044a80, 0xc42b409101, 0x14, 0x14, 0x1, 0xc42594a9c0)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:841 +0x43\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).tryEnterProposal(0xc42b044a80, 0xba5f7, 0x0, 0x1)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:707 +0x47b\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).enterNewRound(0xc42b044a80, 0xba5f7, 0x0)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:671 +0x64e\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).handleTimeout(0xc42b044a80, 0x3b9a3088, 0xba5f7, 0x0, 0x1, 0x1, 0xba5f7, 0x0, 0x1, 0xbf052cc1c964f145, ...)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:597 +0x536\ngithub.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).receiveRoutine(0xc42b044a80, 0x0)\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:523 +0x473\ncreated by github.com/truechain/truechain-engineering-code/consensus/tbft.(*ConsensusState).OnStart\n\t/root/goSpace1/src/github.com/truechain/truechain-engineering-code/build/_workspace/src/github.com/truechain/truechain-engineering-code/consensus/tbft/state.go:221 +0x13c\n"
INFO [01-08|13:56:23.158] Exit receiveRoutine 
INFO [01-08|13:56:32.158] Timed out                                dur=10s          height=763383 round=0 step=RoundStepBlockSync
WARN [01-08|13:56:32.257] synchronise peer nil>>> 
INFO [01-08|13:56:42.197] Peer connected success                   id=ab6fd208251c1033                         conn=dyndial name=Getrue/v0.9.6-unstable-8b7c967b/linux-amd64/go1.10.4 RemoteAddr=192.144.143.96:30313
INFO [01-08|13:56:42.219] Peer connected success                   id=f684c0103dee129e                         conn=dyndial name=Getrue/v0.9.6-unstable-8b7c967b/linux-amd64/go1.10.4 RemoteAddr=192.144.141.61:30313
INFO [01-08|13:56:42.257] pm_synchronise                           pTd=196206916 td=196206916 NumberU64=11955
wbqlove commented 5 years ago

Solve this problem of slow block and nil pointer Address Https://github.com/truechain/truechain-engineering-code/commit/089a457970456d3b7b2b829db6ef34e51be1a8f9 Comment address Https://github.com/truechain/truechain-engineering-code/commit/a8de87cc54f6fde9a05eb5b8b6caba6a431a3a5a