Skip to content

panic on apple m1 (nil pointer) #9

@meowsbits

Description

@meowsbits

An error in the core-geth tests happens on Apple M1 architecture.
The backtrace points to https://github.com/etclabscore/go-openrpc-reflect/blob/master/common.go#L372.

cc @ziogaschr @diega

--- FAIL: TestRPCDiscover (0.02s)
    ethclient_test.go:760: method handler crashed
INFO [08-23|14:31:19.398] Persisted trie from memory database      nodes=1 size=146.00B time="2.583µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1  livesize=0.00B
WARN [08-23|14:31:19.399] Sanitizing invalid miner gas price       provided=<nil> updated=1,000,000,000
INFO [08-23|14:31:19.399] Allocated trie memory caches             clean=0.00B dirty=0.00B
INFO [08-23|14:31:19.399] Writing custom genesis block 
[...]
WARN [08-23|14:31:19.378] Sanitizing invalid gasprice oracle max block history provided=0     updated=1
WARN [08-23|14:31:19.378] Error reading unclean shutdown markers   error="not found"
INFO [08-23|14:31:19.378] Starting peer-to-peer node               instance=CoreGeth/darwin-arm64/go1.18.1
INFO [08-23|14:31:19.379] Imported new chain segment               blocks=2 txs=2 mgas=0.042 elapsed="369.583µs" mgasps=113.642 number=2 hash=4bab76..d2d838 age=53y4mo3w dirty=1.62KiB
INFO [08-23|14:31:19.380] New local node record                    seq=1,661,254,279,379 id=534093df1652cfed ip=127.0.0.1 udp=60777 tcp=0
INFO [08-23|14:31:19.380] Started P2P networking                   self="enode://19bad38415be0fc06add3f32ed62e8890f0bccde8f84eff33c6079678b2a29fedff295ea7ce954838f6695765af55fff6bbb4c2f57b0fe06deea61ab02346fff@127.0.0.1:0?discport=60777"
ERROR[08-23|14:31:19.397] RPC method rpc.discover crashed: runtime error: invalid memory address or nil pointer dereference
goroutine 528 [running]:
github.com/ethereum/go-ethereum/rpc.(*callback).call.func1()
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/service.go:199 +0x74
panic({0x105d48480, 0x106466d90})
        /opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/panic.go:838 +0x204
github.com/etclabscore/go-openrpc-reflect.getAstFuncDecl({0x105e2d4a0?, 0x14000492000?, 0x17?}, {{0x105ca819b, 0x17}, {0x0, 0x0}, {0x105e7d758, 0x1400010f980}, {0x1400010f980, ...}, ...})
        /Users/ziogaschr/Sites/go/pkg/mod/github.com/etclabscore/go-openrpc-reflect@v0.0.36/common.go:372 +0x31c
github.com/etclabscore/go-openrpc-reflect.receiverMethods({0x105e7cf88, 0x1400048ed00}, {0x105223d49, 0x5}, {0x105e2d4a0?, 0x14000492000?})
        /Users/ziogaschr/Sites/go/pkg/mod/github.com/etclabscore/go-openrpc-reflect@v0.0.36/common.go:74 +0x2c4
github.com/etclabscore/go-openrpc-reflect.(*EthereumReflectorT).ReceiverMethods(0x105e2eea0?, {0x105223d49?, 0x1400026a200?}, {0x105e2d4a0?, 0x14000492000?})
        /Users/ziogaschr/Sites/go/pkg/mod/github.com/etclabscore/go-openrpc-reflect@v0.0.36/go-ethereum.go:22 +0x74
github.com/etclabscore/go-openrpc-reflect.(*Document).Discover(0x140006227e0)
        /Users/ziogaschr/Sites/go/pkg/mod/github.com/etclabscore/go-openrpc-reflect@v0.0.36/document.go:188 +0x2f8
github.com/ethereum/go-ethereum/node.(*RPCDiscoveryService).Discover(0x2?)
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/node/openrpc.go:38 +0x24
reflect.Value.call({0x140002d41e0?, 0x14000011ee0?, 0x1067445b8?}, {0x1052227ea, 0x4}, {0x140009641e0, 0x1, 0x104ce143c?})
        /opt/homebrew/Cellar/go/1.18.1/libexec/src/reflect/value.go:556 +0x5e4
reflect.Value.Call({0x140002d41e0?, 0x14000011ee0?, 0x1400094fb80?}, {0x140009641e0, 0x1, 0x2})
        /opt/homebrew/Cellar/go/1.18.1/libexec/src/reflect/value.go:339 +0x98
github.com/ethereum/go-ethereum/rpc.(*callback).call(0x1400091ed20, {0x105e77af0?, 0x14000f21600}, {0x14000425a80, 0xc}, {0x0, 0x0, 0x104cdb460?})
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/service.go:205 +0x38c
github.com/ethereum/go-ethereum/rpc.(*handler).runMethod(0x0?, {0x105e77af0?, 0x14000f21600?}, 0x14000622af0, 0x0?, {0x0?, 0x100010000?, 0x10d75fb70?})
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:389 +0x44
github.com/ethereum/go-ethereum/rpc.(*handler).handleCall(0x140006f1170, 0x14000964180, 0x14000622af0)
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:337 +0x1dc
github.com/ethereum/go-ethereum/rpc.(*handler).handleCallMsg(0x140006f1170, 0x14000964180?, 0x14000622af0)
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:298 +0x80
github.com/ethereum/go-ethereum/rpc.(*handler).handleMsg.func1(0x14000964180)
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:139 +0x38
github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc.func1()
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:226 +0xc4
created by github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc
        /Users/ziogaschr/Sites/go/src/github.com/etclabscore/core-geth/rpc/handler.go:222 +0x90
 
WARN [08-23|14:31:19.397] Served rpc.discover                      reqid=1 duration=17.6825ms err="method handler crashed"
INFO [08-23|14:31:19.397] Ethereum protocol stopped 
INFO [08-23|14:31:19.397] Transaction pool stopped 
INFO [08-23|14:31:19.397] Writing cached state to disk             block=2 hash=4bab76..d2d838 root=0867e4..7f573b
INFO [08-23|14:31:19.397] Persisted trie from memory database      nodes=4 size=576.00B time="9.834µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=4  livesize=406.00B
INFO [08-23|14:31:19.397] Writing cached state to disk             block=1 hash=82b641..3dc6ab root=08c303..e26e42
INFO [08-23|14:31:19.397] Persisted trie from memory database      nodes=3 size=406.00B time="2.833µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1  livesize=0.00B
INFO [08-23|14:31:19.397] Blockchain stopped 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions