Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid number of list elements #15606

Closed
ekhvalov opened this issue Dec 4, 2017 · 1 comment
Closed

invalid number of list elements #15606

ekhvalov opened this issue Dec 4, 2017 · 1 comment
Assignees

Comments

@ekhvalov
Copy link

ekhvalov commented Dec 4, 2017

System information

Geth version: 1.7.3-stable-4bb3c89d
OS & Version: 4.10.0-30-generic #34~16.04.1-Ubuntu

Expected behaviour

sync chain

Actual behaviour

panic: node f4eaf1c79a8d751566fa3228c17195c15ef6e396d09da47159e122093a011cd7: invalid number of list elements: 0

Steps to reproduce the behaviour

geth --cahce 512

Backtrace

INFO [12-04|19:03:17] Imported new chain segment               blocks=2 txs=326 mgas=12.585 elapsed=448.743ms mgasps=28.045 number=4670865 hash=b3989d…7cd8ea
panic: node f4eaf1c79a8d751566fa3228c17195c15ef6e396d09da47159e122093a011cd7: invalid number of list elements: 0

goroutine 645 [running]:
github.com/ethereum/go-ethereum/trie.mustDecodeNode(0xc422f7dd00, 0x20, 0x20, 0xc42612e000, 0x214, 0x240, 0x3, 0x0, 0x0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/node.go:110 +0x203
github.com/ethereum/go-ethereum/trie.(*Trie).resolveHash(0xc42193d8c0, 0xc422f7dd00, 0x20, 0x20, 0xc4225f7270, 0x4, 0x41, 0xc421ac7f53, 0x1, 0x2d, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:454 +0x2bd
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1859460, 0xc424592c00, 0xc4225f7270, 0x41, 0x41, 0x4, 0x20, 0x20, 0xc421ac7d40, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:184 +0xef
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1856b20, 0xc426423040, 0xc4225f7270, 0x41, 0x41, 0x3, 0x1856b20, 0xc426423040, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:176 +0x70e
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1859460, 0xc4255b3c60, 0xc4225f7270, 0x41, 0x41, 0x3, 0x0, 0x0, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:188 +0x22e
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1856b20, 0xc4337c7040, 0xc4225f7270, 0x41, 0x41, 0x2, 0x0, 0x0, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:176 +0x70e
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1856b20, 0xc426422dc0, 0xc4225f7270, 0x41, 0x41, 0x1, 0xcfc2a1ead0e0daa8, 0x818f56d1d5ba8394, 0xe5a9f32f44e5cccf, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:176 +0x70e
github.com/ethereum/go-ethereum/trie.(*Trie).tryGet(0xc42193d8c0, 0x1856b20, 0xc426422f00, 0xc4225f7270, 0x41, 0x41, 0x0, 0xc423100be8, 0x63a808, 0xc431ed5d40, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:176 +0x70e
github.com/ethereum/go-ethereum/trie.(*Trie).TryGet(0xc42193d8c0, 0xc42193d908, 0x20, 0x2b, 0xc42193d908, 0x20, 0x2b, 0xd26c30, 0xc434a94b40)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/trie.go:150 +0x85
github.com/ethereum/go-ethereum/trie.(*SecureTrie).TryGet(0xc42193d8c0, 0xc422f7dc40, 0x14, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/trie/secure_trie.go:84 +0x7b
github.com/ethereum/go-ethereum/core/state.(*StateDB).getStateObject(0xc42614bd10, 0x63ea4309e0e23f00, 0x6af6a56a71220b95, 0xa2b9178e, 0x1)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state/statedb.go:359 +0x132
github.com/ethereum/go-ethereum/core/state.(*StateDB).Exist(0xc42614bd10, 0x63ea4309e0e23f00, 0x6af6a56a71220b95, 0xa2b9178e, 0x0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state/statedb.go:172 +0x3f
github.com/ethereum/go-ethereum/core.(*StateTransition).from(0xc427ea5d50, 0x0, 0x0, 0x0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_transition.go:137 +0x92
github.com/ethereum/go-ethereum/core.(*StateTransition).preCheck(0xc427ea5d50, 0xffb3d8, 0xffb250)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_transition.go:195 +0x58
github.com/ethereum/go-ethereum/core.(*StateTransition).TransitionDb(0xc427ea5d50, 0x185ed60, 0xc423ed3b00, 0xc425585860, 0xc427ea5d50, 0xc423103d90, 0xc423ed3b00, 0xc423ed3b00, 0xf1c4a0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_transition.go:213 +0x43
github.com/ethereum/go-ethereum/core.ApplyMessage(0xc428e61500, 0x185ed60, 0xc423ed3b00, 0xc425585860, 0x6af6a56a71220b95, 0xa2b9178e, 0xc424592ae0, 0x97fd14e7dd4f67ea, 0x71a96af5f0ede39d, 0xc88e896b, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_transition.go:131 +0x5b
github.com/ethereum/go-ethereum/core.ApplyTransaction(0x1826e20, 0xc4216cc000, 0x0, 0xc425585860, 0xc42614bd10, 0xc4218906c0, 0xc432e52750, 0xc4255857a0, 0x0, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_processor.go:101 +0x29e
github.com/ethereum/go-ethereum/core.(*StateProcessor).Process(0xc420210b40, 0xc43348c3f0, 0xc42614bd10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/state_processor.go:73 +0x5d9
github.com/ethereum/go-ethereum/core.(*BlockChain).insertChain(0xc4216cc000, 0xc422d9ed40, 0x7, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/blockchain.go:971 +0x1dcf
github.com/ethereum/go-ethereum/core.(*BlockChain).InsertChain(0xc4216cc000, 0xc422d9ed40, 0x7, 0x7, 0xc432f5bfc0, 0x1, 0x4)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/core/blockchain.go:864 +0x67
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).importBlockResults(0xc420202b60, 0xc422d9ed00, 0x7, 0x7, 0x0, 0x0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/downloader.go:1359 +0x189
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).processFullSyncContent(0xc420202b60, 0xc424e6d798, 0x29c2d6a8d8d745e6)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/downloader.go:1334 +0x74
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).(github.com/ethereum/go-ethereum/eth/downloader.processFullSyncContent)-fm(0x2044efd700000008, 0xffd8b0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/downloader.go:482 +0x2a
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).spawnSync.func1(0xc422d992f0, 0xc42353a120, 0xc421630bf0)
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/downloader.go:500 +0x51
created by github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).spawnSync
        /build/ethereum-ZSPmrv/ethereum-1.7.3+build11486+xenial/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/downloader.go:500 +0xc7

checknode.go content:

package main

import (
	"encoding/hex"
	"fmt"
	"os"

	"github.com/ethereum/go-ethereum/ethdb"
)

func main() {
	db, _ := ethdb.NewLDBDatabase(os.Args[1], 100, 100)
	key, _ := hex.DecodeString("f4eaf1c79a8d751566fa3228c17195c15ef6e396d09da47159e122093a011cd7")
	val, _ := db.Get(key)
	fmt.Println(hex.EncodeToString(val))
}

go run checknode.go ~/.ethereum/geth/chaindata output:

f90211a01883f81666ae43c52dfb9a25b10383b50c28757cb14ac35bff92338bd891a653a02fbce5296d4cf64818c88e1c4ba19bb6465898f0a3bbf0dfa18e033c890608aea02fcbff919578906b51139fa3c68cb42159f58d0928aa8f2eef6b23f59a661f15a08f76ea26fde009c7ec2299a15cf521304bac5331b8350cd29a077821b0ebaa40a013f66030e5d9d33c6a49341fcfffeb16920ac75ae9d8934ccba38ab38bd5c917a03d3350c9dc07083ed28569f107f988a30b85b5058ff7b77b51b8de6fcfa89761a0e0d7a85426e462e5a3652b3cd0068fe03b3e2265c500c1d7cec4326570af9119a02742ea1b67bffd2883143ed1f01a029598b0eff8fb1b339fdafcdb9a09402444a083f9a4d2d055b01c01281592371d71fdaa09fe606a374174018d2064fb2f2901a0cab4930e22930ebda82c23c3ee8747625794030400000000ef023304000000000000000000000000000000000000000000000000000000009aee3204000000005608000000000000ff0b000000000000c8ad37e87f96eedcae501520d71edac13878a063e765d33fa7b7d4656d815ef1bee58d28c9418db30e441a23c0c21843b7655ea05e1de5f1c360c5ab61c0fc991e783342ac68a93ed18ab1cdd7e577f415836424a0cf8ac7bee3caa01c662a5fdf8a761a1db972e084c63e6fd1e3b65fda44d7eeefa0b4d524b99aaddb280e6e777e0af54d59057f131dd64eb225f9757f0069b6faab80
@fjl fjl self-assigned this Dec 5, 2017
@stale
Copy link

stale bot commented Dec 6, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status:inactive label Dec 6, 2018
@stale stale bot closed this as completed Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants