koinos/koinos-block-store

SIGSEGV when requesting a block at height 0

mvandeberg opened this issue · 0 comments

This in on the protobuf branch.

I called GetBlocksByHeight via RPC with the following parameters:

HeadBlockID: 0x122037803bee2a2a464f9ac44a27427b144b2889a41483c7f84c318f69e6a581d08b
AncestorStartHeight: 0
NumBlocks: 1

block_store_1     | panic: runtime error: invalid memory address or nil pointer dereference
block_store_1     | [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x8794eb]
block_store_1     |
block_store_1     | goroutine 59 [running]:
block_store_1     | github.com/koinos/koinos-block-store/internal/bstore.(*RequestHandler).GetBlocksByHeight(0xc0001ce200, 0xc00560b590, 0x844490, 0xc0000aaca8, 0xff)
block_store_1     |     /koinos-block-store/internal/bstore/reqhandler.go:256 +0x20b
block_store_1     | github.com/koinos/koinos-block-store/internal/bstore.(*RequestHandler).HandleRequest(0xc0001ce200, 0xc0001e2f80, 0xc0055bd8d0)
block_store_1     |     /koinos-block-store/internal/bstore/reqhandler.go:522 +0x317
block_store_1     | main.main.func1(0x9dc534, 0xb, 0xc005619740, 0x2a, 0x2a, 0x0, 0x0, 0x40f3fb, 0x0, 0x0)
block_store_1     |     /koinos-block-store/cmd/koinos-block-store/main.go:118 +0x475
block_store_1     | github.com/koinos/koinos-mq-golang.(*RequestHandler).HandleRPCDelivery(0xc0000d0780, 0x9dc534, 0xb, 0xc0055bdc30, 0x0)
block_store_1     |     /go/pkg/mod/github.com/koinos/koinos-mq-golang@v0.0.0-20210424202816-d2bd4d1894d1/request_handler.go:212 +0xbf
block_store_1     | github.com/koinos/koinos-mq-golang.(*RequestHandler).ConsumeRPCLoop(0xc0000d0780, 0xc0000907e0, 0x9dc534, 0xb, 0xc0001fe000)
block_store_1     |     /go/pkg/mod/github.com/koinos/koinos-mq-golang@v0.0.0-20210424202816-d2bd4d1894d1/request_handler.go:176 +0x14b
block_store_1     | created by github.com/koinos/koinos-mq-golang.(*RequestHandler).ConnectLoop
block_store_1     |     /go/pkg/mod/github.com/koinos/koinos-mq-golang@v0.0.0-20210424202816-d2bd4d1894d1/request_handler.go:123 +0x20f

The expected behavior is for the program to not crash.