ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.31k stars 20.03k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #22835

Closed multivars closed 10 months ago

multivars commented 3 years ago

System information

Geth version: Version: 1.10.3-stable Architecture: arm64 Go Version: go1.16.3 Operating System: darwin

OS & Version: OSX

Expected behaviour

No crashes

Actual behaviour

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x1c0 pc=0x10472ad00]

goroutine 645374 [running]:
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestorBinarySearch(0x14006fa1c20, 0x14019ff0000, 0x100000001, 0xbcfc99, 0xbb9cb3, 0xbb9cb3, 0x0, 0x10509bcd8)
    github.com/ethereum/go-ethereum/eth/downloader/downloader.go:988 +0x440
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestor(0x14006fa1c20, 0x14019ff0000, 0x14025d5a480, 0x1400067ab40, 0x0, 0x0)
    github.com/ethereum/go-ethereum/eth/downloader/downloader.go:840 +0x338
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).syncWithPeer(0x14006fa1c20, 0x14019ff0000, 0x93275d9e27d9cc81, 0x20880d02a23dad6b, 0xefba04bd94c4dbfb, 0x632ca43bf48c30be, 0x1404d8ac5c0, 0x0, 0x0)
    github.com/ethereum/go-ethereum/eth/downloader/downloader.go:497 +0x3c0
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).synchronise(0x14006fa1c20, 0x1403876e040, 0x40, 0x93275d9e27d9cc81, 0x20880d02a23dad6b, 0xefba04bd94c4dbfb, 0x632ca43bf48c30be, 0x1404d8ac5c0, 0x1, 0x0, ...)
    github.com/ethereum/go-ethereum/eth/downloader/downloader.go:453 +0x31c
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).Synchronise(0x14006fa1c20, 0x1403876e040, 0x40, 0x93275d9e27d9cc81, 0x20880d02a23dad6b, 0xefba04bd94c4dbfb, 0x632ca43bf48c30be, 0x1404d8ac5c0, 0x23ac5c4400000002, 0x8b4b0ae95c9805f1, ...)
    github.com/ethereum/go-ethereum/eth/downloader/downloader.go:348 +0x6c
github.com/ethereum/go-ethereum/eth.(*handler).doSync(0x140073c0000, 0x1403937e0c0, 0x1403c7781c0, 0x1c738c98100323fe)
    github.com/ethereum/go-ethereum/eth/sync.go:324 +0x100
github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync.func1(0x14006efd950, 0x1403937e0c0)
    github.com/ethereum/go-ethereum/eth/sync.go:300 +0x34
created by github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync
    github.com/ethereum/go-ethereum/eth/sync.go:300 +0x78
RaibeartRuadh commented 3 years ago

Version:v1.10.1

I have a similar situation with a node crash on testnet mode:

command: --syncmode full --ropsten --nousb --http.api admin,personal,txpool,eth,web3 --http --http.addr 0.0.0.0 --cache=12288 --maxpeers=200 Crash log:

INFO [05-11|13:43:19.932] Block synchronisation started
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1c0 pc=0xb1ecaf]

goroutine 1489 [running]:
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestorBinarySearch(0xc00000c3c0, 0xc0da534d20, 0x0, 0x9bdc11, 0x98f379, 0x98f379, 0x0, 0x1539120)
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:977 +0x58f
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestor(0xc00000c3c0, 0xc0da534d20, 0xc0da37a6c0, 0x0, 0x0, 0x0)
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:829 +0x3a5
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).syncWithPeer(0xc00000c3c0, 0xc0da534d20, 0x9f9484732b7d3a6e, 0xa18ab4d23daa471e, 0x24e637921e99d771, 0x89d0b52e3c9ca486, 0xc045dca980, 0x0, 0x0)
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:486 +0x517
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).synchronise(0xc00000c3c0, 0xc0f1aa8ac0, 0x40, 0x9f9484732b7d3a6e, 0xa18ab4d23daa471e, 0x24e637921e99d771, 0x89d0b52e3c9ca486, 0xc045dca980, 0xc000000000, 0x0, ...)
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:442 +0x3b1
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).Synchronise(0xc00000c3c0, 0xc0f1aa8ac0, 0x40, 0x9f9484732b7d3a6e, 0xa18ab4d23daa471e, 0x24e637921e99d771, 0x89d0b52e3c9ca486, 0xc045dca980, 0xc000000000, 0xd9090e, ...)
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:343 +0x8c
github.com/ethereum/go-ethereum/eth.(*handler).doSync(0xc0222fba00, 0xc03772cec0, 0x1408088, 0xc000277420)
        github.com/ethereum/go-ethereum/eth/sync.go:324 +0x125
github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync.func1(0xc0182ff200, 0xc03772cec0)
        github.com/ethereum/go-ethereum/eth/sync.go:300 +0x38
created by github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync
        github.com/ethereum/go-ethereum/eth/sync.go:300 +0x76
DeFiYaco commented 3 years ago

Same error on my 1.10.3 node --syncmode full --snapshot=false --ropsten --http --http.api personal,eth,net,web3 --http.addr 0.0.0.0

holiman commented 3 years ago

When these types of errors occur, it would be useful to see a bit more of the logs preceding the crash, and perhaps in particular the logs that are emitted during the start-up procedure.

corymsmith commented 3 years ago

@holiman I'm seeing the same thing right now. Our Ropsten node is crashing on this line over and over and I'm not sure how to get it to recover:

if header.Number.Uint64() != check { here: https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/downloader.go#L966

Logs

DEBUG[07-07|18:32:25.015] Synchronising with the network peer=cb2bf0beb664e1dad1af77fe86d9eeb33c36f148d8dc9f786c24442ad42483ad eth=66 head=d831b8..5c30df td=33,994,265,417,841,093 mode=full

DEBUG[07-07|18:32:25.015] Retrieving remote chain head peer=cb2bf0be

DEBUG[07-07|18:32:25.015] Recalculated msgrate QoS values proto=eth rtt=20s confidence=0.562 ttl=1m0s next=2021-07-07T18:32:45+0000

TRACE[07-07|18:32:25.015] Debug dump of mean capacities proto=eth caps=map[]

DEBUG[07-07|18:32:25.015] Fetching batch of headers id=cb2bf0beb664e1da conn=dyndial count=1 fromhash=d831b8..5c30df skip=63 reverse=true

TRACE[07-07|18:32:25.066] DNS discovery lookup name=GAYDIKTRA7G3LGXQVOJI6ASW4Q.all.ropsten.ethdisco.net err=nil

TRACE[07-07|18:32:25.109] Filtering headers peer=cb2bf0beb664e1dad1af77fe86d9eeb33c36f148d8dc9f786c24442ad42483ad headers=1

DEBUG[07-07|18:32:25.109] Remote head identified, no pivot peer=cb2bf0be number=10,590,364 hash=d831b8..5c30df

DEBUG[07-07|18:32:25.109] Looking for common ancestor peer=cb2bf0be local=10,481,606 remote=10,590,364

TRACE[07-07|18:32:25.109] Span searching for common ancestor peer=cb2bf0be count=12 from=10,590,187 skip=15

DEBUG[07-07|18:32:25.109] Fetching batch of headers id=cb2bf0beb664e1da conn=dyndial count=12 fromnum=10,590,187 skip=15 reverse=false

TRACE[07-07|18:32:25.203] Binary searching for common ancestor peer=cb2bf0be start=10,391,606 end=10,590,364

DEBUG[07-07|18:32:25.203] Fetching batch of headers id=cb2bf0beb664e1da conn=dyndial count=1 fromnum=10,490,985 skip=0 reverse=false

TRACE[07-07|18:32:25.297] Filtering headers peer=cb2bf0beb664e1dad1af77fe86d9eeb33c36f148d8dc9f786c24442ad42483ad headers=1

DEBUG[07-07|18:32:25.299] Synchronisation terminated elapsed=284.044ms

main
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x1c0 pc=0xb4832f] goroutine 2539 [running]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestorBinarySearch(0xc0027a6540, 0xc020ffdc70, 0x0, 0xa1989c, 0x9e9036, 0x9e9036, 0x0, 0x157f660) github.com/ethereum/go-ethereum/eth/downloader/downloader.go:966 +0x58f github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestor(0xc0027a6540, 0xc020ffdc70, 0xc00009c480, 0x0, 0x0, 0x0) github.com/ethereum/go-ethereum/eth/downloader/downloader.go:818 +0x3a5 github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).syncWithPeer(0xc0027a6540, 0xc020ffdc70, 0xb9625a4e20b831d8, 0x3e31fd09191305df, 0xf7da9b5309f63afc, 0xdf305c5bb64df056, 0xc06fec26a0, 0x0, 0x0) github.com/ethereum/go-ethereum/eth/downloader/downloader.go:475 +0x517 github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).synchronise(0xc0027a6540, 0xc043d05ac0, 0x40, 0xb9625a4e20b831d8, 0x3e31fd09191305df, 0xf7da9b5309f63afc, 0xdf305c5bb64df056, 0xc06fec26a0, 0xc000000000, 0x0, ...) github.com/ethereum/go-ethereum/eth/downloader/downloader.go:431 +0x3b0 github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).Synchronise(0xc0027a6540, 0xc043d05ac0, 0x40, 0xb9625a4e20b831d8, 0x3e31fd09191305df, 0xf7da9b5309f63afc, 0xdf305c5bb64df056, 0xc06fec26a0, 0xc000000000, 0x481320, ...) github.com/ethereum/go-ethereum/eth/downloader/downloader.go:326 +0x8c github.com/ethereum/go-ethereum/eth.(*handler).doSync(0xc0005d5700, 0xc07d9e2e00, 0xaef775, 0xc071c70fc0) github.com/ethereum/go-ethereum/eth/sync.go:324 +0x125 github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync.func1(0xc002860c30, 0xc07d9e2e00) github.com/ethereum/go-ethereum/eth/sync.go:300 +0x38 created by github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync github.com/ethereum/go-ethereum/eth/sync.go:300 +0x76
coopermaruyama commented 3 years ago

Also getting this issue since upgrading to 1.10.4

There are the flags I'm using:

geth --ropsten --http --http.addr "0.0.0.0" --http.corsdomain "*" --http.vhosts="REDACTED" --gpo.percentile 90 --gpo.blocks 200 --txlookuplimit=0 --cache.preimages --txlookuplimit=0 --snapshot=false --cache 10248 --syncmode=full

Here is 2 full iterations of it crashing from the logs:

Jul 07 19:57:02 ip-10-0-0-44 systemd[1]: Started geth.
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.075] Starting Geth on Ropsten testnet...
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.078] Maximum peer count                       ETH=50 LES=0 total=50
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.078] Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`.
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.078] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.079] Sanitizing cache to Go's GC limits       provided=10248 updated=5337
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.079] Set global gas cap                       cap=50,000,000
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.081] Allocated trie memory caches             clean=800.00MiB dirty=1.30GiB
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.081] Allocated cache and file handles         database=/home/ubuntu/.ethereum/ropsten/geth/chaindata cache=2.61GiB handles=2048
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.709] Opened ancient database                  database=/home/ubuntu/.ethereum/ropsten/geth/chaindata/ancient readonly=false
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.715] Persisted trie from memory database      nodes=355 size=50.41KiB time="879.666µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.716] Initialised chain configuration          config="{ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Byzantium: 1700000 Constantinople: 4230000 Petersburg: 4939394 Istanbul: 6485846, Muir Glacier: 7117117, Berlin: 9812189, London: 10499401, Engine: ethash}"
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.832] Disk storage enabled for ethash caches   dir=/home/ubuntu/.ethereum/ropsten/geth/ethash count=3
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.832] Disk storage enabled for ethash DAGs     dir=/home/ubuntu/.ethash count=2
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.833] Initialising Ethereum protocol           network=3 dbversion=8
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.834] Loaded most recent local header          number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.834] Loaded most recent local full block      number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.834] Loaded most recent local fast block      number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.834] Loaded last fast-sync pivot marker       number=9,811,393
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.836] Resuming state snapshot generation       root=fbf989..47b111 at=00d79f..41259e accounts=106,076 slots=1,318,383 storage=95.82MiB elapsed="60.958µs"
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.836] Loaded local transaction journal         transactions=0 dropped=0
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.836] Regenerated local transaction journal    transactions=0 accounts=0
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.837] Gasprice oracle is ignoring threshold set threshold=2
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Old unclean shutdowns found              count=920
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:12+0000 age=50s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:24+0000 age=38s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:28+0000 age=34s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:31+0000 age=31s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:35+0000 age=27s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:39+0000 age=23s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:44+0000 age=18s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:48+0000 age=14s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:54+0000 age=8s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:56:57+0000 age=5s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: WARN [07-07|19:57:02.837] Unclean shutdown detected                booted=2021-07-07T19:57:00+0000 age=2s
Jul 07 19:57:02 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:02.837] Starting peer-to-peer node               instance=Geth/v1.10.4-stable-aa637fd3/linux-amd64/go1.16.4
Jul 07 19:57:03 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:03.362] New local node record                    seq=1252 id=9999030f60472d1d ip=127.0.0.1 udp=30303 tcp=30303
Jul 07 19:57:03 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:03.364] IPC endpoint opened                      url=/home/ubuntu/.ethereum/ropsten/geth.ipc
Jul 07 19:57:03 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:03.365] HTTP server started                      endpoint=[::]:8545 prefix= cors=* vhosts=eth-testnet.coincircle.com
Jul 07 19:57:03 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:03.365] Started P2P networking                   self=enode://ec98362499f16f7ccacdcec35fecb0ca2675c0b655430ad182bdd76753520b351ea5893da5c48e6f4400c035120cf65688d4113a0a20e927a1e2a4391d151242@127.0.0.1:30303
Jul 07 19:57:06 ip-10-0-0-44 geth[620]: INFO [07-07|19:57:06.904] Block synchronisation started
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: panic: runtime error: invalid memory address or nil pointer dereference
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x1c0 pc=0xb4428f]
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: goroutine 12378 [running]:
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestorBinarySearch(0xc003b62e00, 0xc005d271e0, 0x0, 0xa199e5, 0x9462b6, 0x9462b6, 0x0, 0x157a640)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:966 +0x58f
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestor(0xc003b62e00, 0xc005d271e0, 0xc00013a240, 0x0, 0x0, 0x0)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:818 +0x3a5
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).syncWithPeer(0xc003b62e00, 0xc005d271e0, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc019e61400, 0x0, 0x0)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:475 +0x517
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).synchronise(0xc003b62e00, 0xc009503e80, 0x40, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc019e61400, 0xc000000000, 0x0, ...)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:431 +0x3b0
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).Synchronise(0xc003b62e00, 0xc009503e80, 0x40, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc019e61400, 0xc000000000, 0xdb84ae, ...)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:326 +0x8c
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth.(*handler).doSync(0xc000156c00, 0xc0105fec80, 0x1443600, 0xc003a62c40)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/sync.go:324 +0x125
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync.func1(0xc003ca7a70, 0xc0105fec80)
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/sync.go:300 +0x38
Jul 07 19:57:07 ip-10-0-0-44 geth[620]: created by github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync
Jul 07 19:57:07 ip-10-0-0-44 geth[620]:         github.com/ethereum/go-ethereum/eth/sync.go:300 +0x76
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: geth.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: geth.service: Failed with result 'exit-code'.
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: geth.service: Service hold-off time over, scheduling restart.
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: geth.service: Scheduled restart job, restart counter is at 11.
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: Stopped geth.
Jul 07 19:57:07 ip-10-0-0-44 systemd[1]: Started geth.
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.825] Starting Geth on Ropsten testnet...
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.827] Maximum peer count                       ETH=50 LES=0 total=50
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:07.827] Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`.
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.827] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:07.828] Sanitizing cache to Go's GC limits       provided=10248 updated=5337
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.828] Set global gas cap                       cap=50,000,000
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.829] Allocated trie memory caches             clean=800.00MiB dirty=1.30GiB
Jul 07 19:57:07 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:07.829] Allocated cache and file handles         database=/home/ubuntu/.ethereum/ropsten/geth/chaindata cache=2.61GiB handles=2048
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.447] Opened ancient database                  database=/home/ubuntu/.ethereum/ropsten/geth/chaindata/ancient readonly=false
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.453] Persisted trie from memory database      nodes=355 size=50.41KiB time="863.959µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.453] Initialised chain configuration          config="{ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Byzantium: 1700000 Constantinople: 4230000 Petersburg: 4939394 Istanbul: 6485846, Muir Glacier: 7117117, Berlin: 9812189, London: 10499401, Engine: ethash}"
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.566] Disk storage enabled for ethash caches   dir=/home/ubuntu/.ethereum/ropsten/geth/ethash count=3
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.566] Disk storage enabled for ethash DAGs     dir=/home/ubuntu/.ethash count=2
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.566] Initialising Ethereum protocol           network=3 dbversion=8
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.567] Loaded most recent local header          number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.568] Loaded most recent local full block      number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.568] Loaded most recent local fast block      number=9,814,598 hash=cafd68..e4fa03 td=32,971,859,168,040,298 age=3mo4w11h
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.568] Loaded last fast-sync pivot marker       number=9,811,393
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.569] Resuming state snapshot generation       root=fbf989..47b111 at=00d79f..41259e accounts=106,076 slots=1,318,383 storage=95.82MiB elapsed="70.607µs"
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.569] Loaded local transaction journal         transactions=0 dropped=0
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.570] Regenerated local transaction journal    transactions=0 accounts=0
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.570] Gasprice oracle is ignoring threshold set threshold=2
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Old unclean shutdowns found              count=921
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:24+0000 age=44s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:28+0000 age=40s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:31+0000 age=37s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:35+0000 age=33s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:39+0000 age=29s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:44+0000 age=24s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:48+0000 age=20s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:54+0000 age=14s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:56:57+0000 age=11s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:57:00+0000 age=8s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: WARN [07-07|19:57:08.570] Unclean shutdown detected                booted=2021-07-07T19:57:02+0000 age=6s
Jul 07 19:57:08 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:08.570] Starting peer-to-peer node               instance=Geth/v1.10.4-stable-aa637fd3/linux-amd64/go1.16.4
qJul 07 19:57:09 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:09.156] New local node record                    seq=1253 id=9999030f60472d1d ip=127.0.0.1 udp=30303 tcp=30303
Jul 07 19:57:09 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:09.158] IPC endpoint opened                      url=/home/ubuntu/.ethereum/ropsten/geth.ipc
Jul 07 19:57:09 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:09.159] HTTP server started                      endpoint=[::]:8545 prefix= cors=* vhosts=eth-testnet.coincircle.com
Jul 07 19:57:09 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:09.159] Started P2P networking                   self=enode://ec98362499f16f7ccacdcec35fecb0ca2675c0b655430ad182bdd76753520b351ea5893da5c48e6f4400c035120cf65688d4113a0a20e927a1e2a4391d151242@127.0.0.1:30303
Jul 07 19:57:12 ip-10-0-0-44 geth[672]: INFO [07-07|19:57:12.802] Block synchronisation started
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: panic: runtime error: invalid memory address or nil pointer dereference
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x1c0 pc=0xb4428f]
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: goroutine 13412 [running]:
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestorBinarySearch(0xc002797180, 0xc0186bc410, 0x0, 0xa199e5, 0x9462b6, 0x9462b6, 0x0, 0x157a640)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:966 +0x58f
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).findAncestor(0xc002797180, 0xc0186bc410, 0xc002908240, 0x0, 0x0, 0x0)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:818 +0x3a5
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).syncWithPeer(0xc002797180, 0xc0186bc410, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc01f7374c0, 0x0, 0x0)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:475 +0x517
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).synchronise(0xc002797180, 0xc0169bc3c0, 0x40, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc01f7374c0, 0xc000000000, 0x0, ...)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:431 +0x3b0
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).Synchronise(0xc002797180, 0xc0169bc3c0, 0x40, 0xe5b3b5c3de246936, 0x2c12d02f7f07c59, 0x51ef8696c18a8034, 0x52e6ad956d27338b, 0xc01f7374c0, 0xc000000000, 0xdb84ae, ...)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/downloader/downloader.go:326 +0x8c
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth.(*handler).doSync(0xc0007fca00, 0xc003e5a040, 0x1443600, 0xc0000f69a0)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/sync.go:324 +0x125
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync.func1(0xc00278bf50, 0xc003e5a040)
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/sync.go:300 +0x38
Jul 07 19:57:13 ip-10-0-0-44 geth[672]: created by github.com/ethereum/go-ethereum/eth.(*chainSyncer).startSync
Jul 07 19:57:13 ip-10-0-0-44 geth[672]:         github.com/ethereum/go-ethereum/eth/sync.go:300 +0x76
Jul 07 19:57:13 ip-10-0-0-44 systemd[1]: geth.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 07 19:57:13 ip-10-0-0-44 systemd[1]: geth.service: Failed with result 'exit-code'.
Jul 07 19:57:13 ip-10-0-0-44 systemd[1]: geth.service: Service hold-off time over, scheduling restart.
Jul 07 19:57:13 ip-10-0-0-44 systemd[1]: geth.service: Scheduled restart job, restart counter is at 12.
coopermaruyama commented 3 years ago

Follow up, I ended up just deleting the data directory and syncing from scratch. Even after running geth removedb this error was still persisting. Only after I deleted the data directory was this issue resolved.

holiman commented 3 years ago

You need 'geth --ropsten removedb', otherwise it removes mainnet.

kumavis commented 2 years ago

getting this as well https://github.com/ethereum/go-ethereum/issues/25731

holiman commented 10 months ago

This seems to be not relevant any more, it was two+ years since it was filed.