bttcprotocol/bttc

Invalid memory address or nil pointer dereference

daniel-tron opened this issue · 2 comments

Got below error in the final step.

CentOS 7
$ ./delivery-start.sh
+ NODE_DIR=/data/bttc/node
+ DELIVERY_HOME_DIR=/data/bttc/node/deliveryd
+ deliveryd --home /data/bttc/node/deliveryd start
I[2022-01-08|16:05:45.467] starting ABCI with Tendermint module=main
ERROR: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain

$ ./bttc-start.sh
INFO [01-08|15:44:00.628] Starting pprof server addr=http://0.0.0.0:7071/debug/pprof
INFO [01-08|15:44:00.628] Enabling metrics collection
INFO [01-08|15:44:00.632] Maximum peer count ETH=200 LES=0 total=200
INFO [01-08|15:44:00.632] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
WARN [01-08|15:44:00.632] Found deprecated node list file /data/bttc/node/bttc/data/bor/static-nodes.json, please use the TOML config file instead.
WARN [01-08|15:44:00.632] The generic --miner.gastarget flag is deprecated and will be removed in the future!
INFO [01-08|15:44:00.633] Set global gas cap cap=50,000,000
INFO [01-08|15:44:00.633] Allocated trie memory caches clean=154.00MiB dirty=256.00MiB
INFO [01-08|15:44:00.633] Allocated cache and file handles database=/data/bttc/node/bttc/data/bor/chaindata cache=512.00MiB handles=2048
INFO [01-08|15:44:00.650] Opened ancient database database=/data/bttc/node/bttc/data/bor/chaindata/ancient readonly=false
INFO [01-08|15:44:00.652] Initialised chain configuration config="{ChainID: 1029 Homestead: 0 DAO: DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: , Engine: bor}"
INFO [01-08|15:44:00.653] Unprotected transactions allowed
INFO [01-08|15:44:00.653] Gasprice oracle is ignoring threshold set threshold=2
INFO [01-08|15:44:00.656] Initialising Ethereum protocol network=1029 dbversion=8
INFO [01-08|15:44:00.657] Loaded most recent local header number=0 hash=fd9284..6543be td=1 age=2y8mo4d
INFO [01-08|15:44:00.657] Loaded most recent local full block number=0 hash=fd9284..6543be td=1 age=2y8mo4d
INFO [01-08|15:44:00.657] Loaded most recent local fast block number=0 hash=fd9284..6543be td=1 age=2y8mo4d
WARN [01-08|15:44:00.658] Loaded snapshot journal diskroot=e73b15..a22683 diffs=missing
WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:40:01+0000 age=3m59s
WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:40:29+0000 age=3m31s
WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:42:28+0000 age=1m32s
INFO [01-08|15:44:00.659] Starting peer-to-peer node instance=bor/v1.0.1-stable-53491784/linux-amd64/go1.15.14
INFO [01-08|15:44:00.679] New local node record seq=4 id=482b3ab172aaeacb ip=127.0.0.1 udp=30303 tcp=30303
INFO [01-08|15:44:00.683] Started P2P networking self=enode://b3ae5c5f83498ea231feaf3b8ca2b96002776370fdb75a51dc635fe8b748430521a9dd5abbfd4a2c09fca15877e2e9af7a531b9f12f6f2799bff3c8d094ead0c@127.0.0.1:30303
INFO [01-08|15:44:00.683] IPC endpoint opened url=/data/bttc/node/bttc/data/bttc.ipc
INFO [01-08|15:44:00.684] HTTP server started endpoint=[::]:8545 prefix= cors=* vhosts=*
INFO [01-08|15:44:00.745] Unlocked account address=0x343c033f27e4d1C917725c754C5c04639264e8d4
INFO [01-08|15:44:00.745] Transaction pool price threshold updated price=300,000,000,000,000
INFO [01-08|15:44:00.745] Transaction pool price threshold updated price=300,000,000,000,000
INFO [01-08|15:44:00.745] Etherbase automatically configured address=0x343c033f27e4d1C917725c754C5c04639264e8d4
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbeb6fd]

goroutine 56 [running]:
github.com/ethereum/go-ethereum/consensus/bor.(*Snapshot).Difficulty(0xc0003d26e0, 0xc9d1e4273f033c34, 0x63045c4c755c7217, 0xd4e86492, 0xd0e26adc8f8492fd)
github.com/ethereum/go-ethereum/consensus/bor/snapshot.go:210 +0xdd
github.com/ethereum/go-ethereum/consensus/bor.(*Bor).Prepare(0xc000360f00, 0x184a6a0, 0xc0007a2000, 0xc0011d2480, 0xbe436572af590937, 0x8)
github.com/ethereum/go-ethereum/consensus/bor/bor.go:610 +0x17d
github.com/ethereum/go-ethereum/miner.(*worker).commitNewWork(0xc0003dd8c0, 0xc0008d1f00, 0x0, 0x61d9b140)
github.com/ethereum/go-ethereum/miner/worker.go:920 +0x3b5
github.com/ethereum/go-ethereum/miner.(*worker).mainLoop(0xc0003dd8c0)
github.com/ethereum/go-ethereum/miner/worker.go:456 +0xe26
created by github.com/ethereum/go-ethereum/miner.newWorker
github.com/ethereum/go-ethereum/miner/worker.go:228 +0x52e

Got below error in the final step.

CentOS 7 $ ./delivery-start.sh + NODE_DIR=/data/bttc/node + DELIVERY_HOME_DIR=/data/bttc/node/deliveryd + deliveryd --home /data/bttc/node/deliveryd start I[2022-01-08|16:05:45.467] starting ABCI with Tendermint module=main ERROR: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain

$ ./bttc-start.sh INFO [01-08|15:44:00.628] Starting pprof server addr=http://0.0.0.0:7071/debug/pprof INFO [01-08|15:44:00.628] Enabling metrics collection INFO [01-08|15:44:00.632] Maximum peer count ETH=200 LES=0 total=200 INFO [01-08|15:44:00.632] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" WARN [01-08|15:44:00.632] Found deprecated node list file /data/bttc/node/bttc/data/bor/static-nodes.json, please use the TOML config file instead. WARN [01-08|15:44:00.632] The generic --miner.gastarget flag is deprecated and will be removed in the future! INFO [01-08|15:44:00.633] Set global gas cap cap=50,000,000 INFO [01-08|15:44:00.633] Allocated trie memory caches clean=154.00MiB dirty=256.00MiB INFO [01-08|15:44:00.633] Allocated cache and file handles database=/data/bttc/node/bttc/data/bor/chaindata cache=512.00MiB handles=2048 INFO [01-08|15:44:00.650] Opened ancient database database=/data/bttc/node/bttc/data/bor/chaindata/ancient readonly=false INFO [01-08|15:44:00.652] Initialised chain configuration config="{ChainID: 1029 Homestead: 0 DAO: DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: , Engine: bor}" INFO [01-08|15:44:00.653] Unprotected transactions allowed INFO [01-08|15:44:00.653] Gasprice oracle is ignoring threshold set threshold=2 INFO [01-08|15:44:00.656] Initialising Ethereum protocol network=1029 dbversion=8 INFO [01-08|15:44:00.657] Loaded most recent local header number=0 hash=fd9284..6543be td=1 age=2y8mo4d INFO [01-08|15:44:00.657] Loaded most recent local full block number=0 hash=fd9284..6543be td=1 age=2y8mo4d INFO [01-08|15:44:00.657] Loaded most recent local fast block number=0 hash=fd9284..6543be td=1 age=2y8mo4d WARN [01-08|15:44:00.658] Loaded snapshot journal diskroot=e73b15..a22683 diffs=missing WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:40:01+0000 age=3m59s WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:40:29+0000 age=3m31s WARN [01-08|15:44:00.659] Unclean shutdown detected booted=2022-01-08T15:42:28+0000 age=1m32s INFO [01-08|15:44:00.659] Starting peer-to-peer node instance=bor/v1.0.1-stable-53491784/linux-amd64/go1.15.14 INFO [01-08|15:44:00.679] New local node record seq=4 id=482b3ab172aaeacb ip=127.0.0.1 udp=30303 tcp=30303 INFO [01-08|15:44:00.683] Started P2P networking self=enode://b3ae5c5f83498ea231feaf3b8ca2b96002776370fdb75a51dc635fe8b748430521a9dd5abbfd4a2c09fca15877e2e9af7a531b9f12f6f2799bff3c8d094ead0c@127.0.0.1:30303 INFO [01-08|15:44:00.683] IPC endpoint opened url=/data/bttc/node/bttc/data/bttc.ipc INFO [01-08|15:44:00.684] HTTP server started endpoint=[::]:8545 prefix= cors=* vhosts=* INFO [01-08|15:44:00.745] Unlocked account address=0x343c033f27e4d1C917725c754C5c04639264e8d4 INFO [01-08|15:44:00.745] Transaction pool price threshold updated price=300,000,000,000,000 INFO [01-08|15:44:00.745] Transaction pool price threshold updated price=300,000,000,000,000 INFO [01-08|15:44:00.745] Etherbase automatically configured address=0x343c033f27e4d1C917725c754C5c04639264e8d4 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbeb6fd]

goroutine 56 [running]: github.com/ethereum/go-ethereum/consensus/bor.(*Snapshot).Difficulty(0xc0003d26e0, 0xc9d1e4273f033c34, 0x63045c4c755c7217, 0xd4e86492, 0xd0e26adc8f8492fd) github.com/ethereum/go-ethereum/consensus/bor/snapshot.go:210 +0xdd github.com/ethereum/go-ethereum/consensus/bor.(*Bor).Prepare(0xc000360f00, 0x184a6a0, 0xc0007a2000, 0xc0011d2480, 0xbe436572af590937, 0x8) github.com/ethereum/go-ethereum/consensus/bor/bor.go:610 +0x17d github.com/ethereum/go-ethereum/miner.(*worker).commitNewWork(0xc0003dd8c0, 0xc0008d1f00, 0x0, 0x61d9b140) github.com/ethereum/go-ethereum/miner/worker.go:920 +0x3b5 github.com/ethereum/go-ethereum/miner.(*worker).mainLoop(0xc0003dd8c0) github.com/ethereum/go-ethereum/miner/worker.go:456 +0xe26 created by github.com/ethereum/go-ethereum/miner.newWorker github.com/ethereum/go-ethereum/miner/worker.go:228 +0x52e

from the error you paste ,seem like the genesis.json file goes something wrong.
could you check if your genesis.json file was pull from the right place and place if the right folder?

fixed by replace genesis.json for both bttc and delivery.