eth.hashrate crashes geth with "panic: runtime error: invalid memory address or nil pointer dereference"
System information
Geth version: 1.7.2-stable
OS & Version: Ubuntu 16.04.4 LTS
Branch, Commit Hash or Release: 2e19f7905d486e6631ba0527cb3de03ff3790a0d
Expected behaviour
eth.hashrate should return 0
Actual behaviour
eth.hashrate crashes geth with "panic: runtime error: invalid memory address or nil pointer dereference"
geth.log:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8f315d] goroutine 791 [running]: github.com/ethereum/go-ethereum/consensus/ethash.(*Ethash).Hashrate(0xc4200ae180, 0x116e140) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/consensus/ethash/ethash.go:586 +0x2d github.com/ethereum/go-ethereum/miner.(*Miner).HashRate(0xc420554b90, 0xc420964030) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/miner/miner.go:145 +0x144 github.com/ethereum/go-ethereum/eth.(*PublicEthereumAPI).Hashrate(0xc42000ef98, 0x0) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/eth/api.go:71 +0x35 reflect.Value.call(0xc4215d9860, 0xc4217401b0, 0x13, 0xf9c459, 0x4, 0xc420699e60, 0x1, 0x1, 0x6fc23a9a8, 0xbebac2192a01d671, ...) /usr/local/go/src/reflect/value.go:447 +0x969 reflect.Value.Call(0xc4215d9860, 0xc4217401b0, 0x13, 0xc42179e660, 0x1, 0x1, 0x0, 0x0, 0x20) /usr/local/go/src/reflect/value.go:308 +0xa4 github.com/ethereum/go-ethereum/rpc.(*Server).handle(0xc421729600, 0x1167fa0, 0xc420f94840, 0x116d8c0, 0xc42045f310, 0xc4208c5a40, 0xc42179e738, 0x42ffb9, 0x2794242400000008) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:311 +0x676 github.com/ethereum/go-ethereum/rpc.(*Server).exec(0xc421729600, 0x1167fa0, 0xc420f94840, 0x116d8c0, 0xc42045f310, 0xc4208c5a40) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:333 +0x1a6 github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest.func2(0xc420f512a0, 0xc421729600, 0xc42024fea0, 0x116d8c0, 0xc42045f310, 0xc42079d6a8, 0x1, 0x1, 0x0) /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:206 +0xad created by github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest /home/afriadmin/quorum-node/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:201 +0x291
Steps to reproduce the behaviour
On any deployment, can use seven node example: make clean git checkout 2e19f7905d486e6631ba0527cb3de03ff3790a0d , (or any descendants including current master: fd0e3b9d13f9b9563e7d5b3b1aba51f035f9cf0d) make all
Backtrace
[backtrace]
Hi, I'm unable to replicate the issue. quorum-examples in raft or istanbul mode both return 0 for eth.hashrate.
Anything interesting in your particular set up?
Hi fixanoid,
did you git checkout 2e19f7905d486e6631ba0527cb3de03ff3790a0d ?
Quorum examples using vagrant checks out v2.0.2 which does not have the bug.
I am using raft by the way. Nothing really particular about my deployment. I managed to reproduce the issue on the 7node example by removing "git checkout tags/v2.0.2" from the bootstrap.sh
Just checked out master and I see it.
From my node log
INFO [06-08|21:07:47] QUORUM-CHECKPOINT name=TX-CREATED tx=0x6fdb35be9fa794b73953a50fc09730dd8878ba5df41f8307164b190be9eeab22 to=0x1349F3e1B8D71eFfb47B840594Ff27dA7E603d17
INFO [06-08|21:07:47] QUORUM-CHECKPOINT name=TX-ACCEPTED tx=0x6fdb35be9fa794b73953a50fc09730dd8878ba5df41f8307164b190be9eeab22
INFO [06-08|21:07:47] Imported new chain segment blocks=1 txs=1 mgas=0.045 elapsed=561.303µs mgasps=80.595 number=5 hash=67d252…72102b
INFO [06-08|21:07:47] QUORUM-CHECKPOINT name=BLOCK-CREATED block=67d25228d18f62b3ace6eb9799fbe71df167fc5c11fa8227cb9aa97b9872102b
INFO [06-08|21:07:47] persisted the latest applied index index=13
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x939cbd]
goroutine 1674 [running]:
github.com/ethereum/go-ethereum/consensus/ethash.(*Ethash).Hashrate(0xc4200963c0, 0x19e6d20)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/consensus/ethash/ethash.go:586 +0x2d
github.com/ethereum/go-ethereum/miner.(*Miner).HashRate(0xc4202449b0, 0xc4204b3dd0)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/miner/miner.go:145 +0x144
github.com/ethereum/go-ethereum/eth.(*PublicEthereumAPI).Hashrate(0xc4200781f8, 0x0)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/eth/api.go:71 +0x35
reflect.Value.call(0xc420a44b40, 0xc420079920, 0x13, 0x1045285, 0x4, 0xc435236e60, 0x1, 0x1, 0x4a817c756, 0xc42001f300, ...)
/usr/local/go/src/reflect/value.go:434 +0x905
reflect.Value.Call(0xc420a44b40, 0xc420079920, 0x13, 0xc424719e60, 0x1, 0x1, 0x431368, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:302 +0xa4
github.com/ethereum/go-ethereum/rpc.(*Server).handle(0xc4201c1a20, 0x19e1c00, 0xc4209f3680, 0x19e6aa0, 0xc420245a40, 0xc435222de0, 0xc4353bd6c0, 0xc420a06060, 0x8d4b23)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:311 +0x6ce
github.com/ethereum/go-ethereum/rpc.(*Server).exec(0xc4201c1a20, 0x19e1c00, 0xc4209f3680, 0x19e6aa0, 0xc420245a40, 0xc435222de0)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:333 +0x1ba
github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest.func2(0xc4224ac1e0, 0xc4201c1a20, 0xc4202b5c20, 0x19e6aa0, 0xc420245a40, 0xc42000e1e0, 0x1, 0x1, 0xc421031d00)
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:206 +0xad
created by github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest
/home/vagrant/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:201 +0x2ab