Skip to content

RPC method crashed: runtime error: invalid memory address or nil pointer dereference #26830

@jdevcs

Description

@jdevcs

With Geth ( recently published stable on docker ) local POA NW when I use safe or finalized tags, geth crashes.

Sample request

curl --location --request POST 'http://127.0.0.1:8545/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "eth_getBlockTransactionCountByNumber",
    "params": [
        "safe"
    ]
}'

returns:

{
    "jsonrpc": "2.0",
    "id": "1",
    "error": {
        "code": -32603,
        "message": "method handler crashed"
    }
}

with logs


INFO [03-08|13:21:04.536] Commit new sealing work                  number=1 sealhash=229c06..5132e5 uncles=0 txs=0 gas=0 fees=0 elapsed="702.427µs"
ERROR[03-08|13:21:39.404] RPC method eth_getBlockTransactionCountByNumber crashed: runtime error: invalid memory address or nil pointer dereference
goroutine 174 [running]:
github.com/ethereum/go-ethereum/rpc.(*callback).call.func1()
	github.com/ethereum/go-ethereum/rpc/service.go:199 +0x89
panic({0x16ef560, 0x2762690})
	runtime/panic.go:884 +0x213
github.com/ethereum/go-ethereum/eth.(*EthAPIBackend).BlockByNumber(0xc000012318, {0x17c0160?, 0x17c0160?}, 0xc00042b5e0?)
	github.com/ethereum/go-ethereum/eth/api_backend.go:132 +0xa0
github.com/ethereum/go-ethereum/internal/ethapi.(*TransactionAPI).GetBlockTransactionCountByNumber(0x1?, {0x1c94978?, 0xc00042b5e0?}, 0x46da59?)
	github.com/ethereum/go-ethereum/internal/ethapi/api.go:1509 +0x2b
reflect.Value.call({0xc0005c2300?, 0xc000297918?, 0x7fc088d928c8?}, {0x19356b1, 0x4}, {0xc00042b680, 0x3, 0x0?})
	reflect/value.go:586 +0xb07
reflect.Value.Call({0xc0005c2300?, 0xc000297918?, 0x1?}, {0xc00042b680?, 0x1?, 0x16?})
	reflect/value.go:370 +0xbc
github.com/ethereum/go-ethereum/rpc.(*callback).call(0xc0001337a0, {0x1c94978?, 0xc00042b5e0}, {0xc00017f110, 0x24}, {0xc000618ca8, 0x1, 0x4d3297?})
	github.com/ethereum/go-ethereum/rpc/service.go:205 +0x3c5
github.com/ethereum/go-ethereum/rpc.(*handler).runMethod(0xc000404558?, {0x1c94978?, 0xc00042b5e0?}, 0xc000214230, 0x1?, {0xc000618ca8?, 0x417230?, 0x1722400?})
	github.com/ethereum/go-ethereum/rpc/handler.go:513 +0x45
github.com/ethereum/go-ethereum/rpc.(*handler).handleCall(0xc00024e240, 0xc0003fef60, 0xc000214230)
	github.com/ethereum/go-ethereum/rpc/handler.go:459 +0x239
github.com/ethereum/go-ethereum/rpc.(*handler).handleCallMsg(0xc00024e240, 0xc0003feff0?, 0xc000214230)
	github.com/ethereum/go-ethereum/rpc/handler.go:420 +0x237
github.com/ethereum/go-ethereum/rpc.(*handler).handleMsg.func1(0xc0003fef60)
	github.com/ethereum/go-ethereum/rpc/handler.go:256 +0x1a5
github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc.func1()
	github.com/ethereum/go-ethereum/rpc/handler.go:348 +0xc5
created by github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc
	github.com/ethereum/go-ethereum/rpc/handler.go:344 +0x8d

when I use geth docker v1.11.2 I am getting expected results:

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": null
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions