quorum icon indicating copy to clipboard operation
quorum copied to clipboard

panic: runtime error: slice out of range

Open michaelkunzmann-sap opened this issue 8 years ago • 5 comments

System information

Geth version: 1.7.2 / Quorum 2.1.0

OS & Version: ubuntu (Docker)

Branch, Commit Hash or Release: 2.1.0

Expected behaviour

Geth runs normally, even with an ethstats dashboard connected.

Actual behaviour

Geth crashes when opening ethstats:

...
TRACE[09-21|17:48:51] Received message from stats server       msg="map[emit:[node-pong map[clientTime:2018-09-21 17:48:51.472812893 +0000 UTC m=+75.405805524 serverTime:1.537552131473e+12]]]"
TRACE[09-21|17:48:51] Sending measured latency to ethstats     latency=0
TRACE[09-21|17:48:51] Sending new block to ethstats            number=0      hash=e54a4f…c66dd6
TRACE[09-21|17:48:51] Sending pending transactions to ethstats count=1
TRACE[09-21|17:48:51] Sending node details to ethstats 
TRACE[09-21|17:48:51] Received message from stats server       msg="map[emit:[history false]]"
WARN [09-21|17:48:51] Invalid stats history request            msg=false
panic: runtime error: slice bounds out of range

goroutine 86 [running]:
github.com/ethereum/go-ethereum/ethstats.(*Service).reportHistory(0xc42009a930, 0xc420210ab0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/quorum-2.1.0/build/_workspace/src/github.com/ethereum/go-ethereum/ethstats/ethstats.go:617 +0x8a0
github.com/ethereum/go-ethereum/ethstats.(*Service).loop(0xc42009a930)
	/quorum-2.1.0/build/_workspace/src/github.com/ethereum/go-ethereum/ethstats/ethstats.go:256 +0xc89
created by github.com/ethereum/go-ethereum/ethstats.(*Service).Start
	/quorum-2.1.0/build/_workspace/src/github.com/ethereum/go-ethereum/ethstats/ethstats.go:123 +0x57

Steps to reproduce the behaviour

  1. Start a new node, connect it to an existing network.
  2. Let is synchronize with the chain (fast sync)
  3. While it synchronizes, node crashes

Geth startup parameters:

geth --datadir /qdata/dd --port 30303 --identity testnet-e48d0cd2-0330-44e9-8b3e-d2eb77d85049 --ethstats testnet-e48d0cd2-0330-44e9-8b3e-d2eb77d85049:uakjzmhxeogzxlahgbsv@testnet-e48d0cd2-0330-44e9-8b3e-d2eb77d85049-http.testnet.svc.cluster.local:3000 --mine --minerthreads 1 --istanbul.requesttimeout 10000 --istanbul.blockperiod 1 --emitcheckpoints --rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum --networkid 959407790 --permissioned --nodiscover --verbosity 5

michaelkunzmann-sap avatar Sep 21 '18 17:09 michaelkunzmann-sap

Hey @michaelkunzmann-sap this code will need some review since we've ripped out pow stuff. We'll take a look.

fixanoid avatar Sep 24 '18 18:09 fixanoid

Hi @michaelkunzmann-sap,   I've not actually been able to recreate this issue, however I believe I've found the cause of it. You can see my fix here: https://github.com/jpmorganchase/quorum/pull/547

Could you test with the branch for this to see if it resolves your issue please: https://github.com/SatpalSandhu61/quorum/tree/fix-ethstats-slice-out-of-range

Thanks.

SatpalSandhu61 avatar Oct 03 '18 11:10 SatpalSandhu61

I've just realised that this is actually fixed in upstream geth under the following PR: https://github.com/ethereum/go-ethereum/pull/15869.

So it will be fixed in Quorum when we perform the upgrade to 1.8.12 (currently awaiting review/merge in the following PR: https://github.com/jpmorganchase/quorum/pull/542).

SatpalSandhu61 avatar Oct 03 '18 16:10 SatpalSandhu61

Hi @SatpalSandhu61 is there a workaround for us in production?

michaelkunzmann-sap avatar Nov 02 '18 21:11 michaelkunzmann-sap

Hi @michaelkunzmann-sap, are you able to apply the fix and rebuild geth? It's a one line fix, which you can find here: https://github.com/ethereum/go-ethereum/pull/15869/files Other than the code change, I can't think of a workaround for it.

SatpalSandhu61 avatar Nov 05 '18 09:11 SatpalSandhu61