capnproto / go-capnp

Cap'n Proto library and code generator for Go

Home Page:https://capnproto.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic (slice out of bounds) in tests

zenhack opened this issue · comments

https://github.com/capnproto/go-capnproto2/actions/runs/3537277747/jobs/5979526799#step:7:742

 panic: runtime error: slice bounds out of range [:72] with capacity 0

goroutine 58 [running]:
capnproto.org/go/capnp/v3.(*Segment).slice(...)
	/home/runner/work/go-capnproto2/go-capnproto2/segment.go:49
capnproto.org/go/capnp/v3.(*Segment).readUint64(...)
	/home/runner/work/go-capnproto2/go-capnproto2/segment.go:65
capnproto.org/go/capnp/v3.(*Segment).readRawPointer(...)
	/home/runner/work/go-capnproto2/go-capnproto2/segment.go:69
capnproto.org/go/capnp/v3.(*Segment).resolveFarPointer(0x908dd80, 0x40)
	/home/runner/work/go-capnproto2/go-capnproto2/segment.go:235 +0xa38
capnproto.org/go/capnp/v3.(*Segment).readPtr(0x908dd80, 0x40, 0xffffffff)
	/home/runner/work/go-capnproto2/go-capnproto2/segment.go:116 +0x4b
capnproto.org/go/capnp/v3.Struct.Ptr({0x908dd80, 0x40, {0x0, 0x1}, 0xffffffff, 0x0}, 0x0)
	/home/runner/work/go-capnproto2/go-capnproto2/struct.go:109 +0x10c
capnproto.org/go/capnp/v3.Transform({0x908dd80, 0x40, 0x0, {0x0, 0x1}, 0xffffffff, 0x0}, {0x90111e0, 0x1, 0x1})
	/home/runner/work/go-capnproto2/go-capnproto2/answer.go:579 +0x17b
capnproto.org/go/capnp/v3.resolution.ptr({{0xa7317bd7216570aa, 0x9, {0x0, 0x0}, {0x0, 0x0}}, {0x908dd80, 0x40, 0x0, {0x0, ...}, ...}, ...}, ...)
	/home/runner/work/go-capnproto2/go-capnproto2/answer.go:605 +0x7b
capnproto.org/go/capnp/v3.resolution.client({{0xa7317bd7216570aa, 0x9, {0x0, 0x0}, {0x0, 0x0}}, {0x908dd80, 0x40, 0x0, {0x0, ...}, ...}, ...}, ...)
	/home/runner/work/go-capnproto2/go-capnproto2/answer.go:614 +0x66
capnproto.org/go/capnp/v3.(*Answer).PipelineRecv(0x9002660, {0x8335320, 0x905cde0}, {0x90111e0, 0x1, 0x1}, {{0x1c8, 0x0, {0x0, 0x0}, ...}, ...})
	/home/runner/work/go-capnproto2/go-capnproto2/answer.go:392 +0x1cc
capnproto.org/go/capnp/v3/server.(*answerQueue).fulfill(0x9053c80, {0x908dd80, 0x40, {0x0, 0x1}, 0xffffffff, 0x0})
	/home/runner/work/go-capnproto2/go-capnproto2/server/answer.go:82 +0x5c6
capnproto.org/go/capnp/v3/server.(*Server).handleCall(0x9053bc0, {0x8335320, 0x905ce10}, 0x9082700)
	/home/runner/work/go-capnproto2/go-capnproto2/server/server.go:215 +0x11a
capnproto.org/go/capnp/v3/server.(*Server).handleCalls.func2(0x9012d08, 0x9053bc0, {0x8335320, 0x905ce10}, 0x9082700)
	/home/runner/work/go-capnproto2/go-capnproto2/server/server.go:182 +0x54
capnproto.org/go/capnp/v3/server.(*Server).handleCalls(0x9053bc0, {0x8335320, 0x905c9c0})
	/home/runner/work/go-capnproto2/go-capnproto2/server/server.go:183 +0x157
created by capnproto.org/go/capnp/v3/server.New
	/home/runner/work/go-capnproto2/go-capnproto2/server/server.go:122 +0x30b
exit status 2
FAIL	capnproto.org/go/capnp/v3/rpc	0.017s

Notes on this one: the issue is that we're releasing the message before answerQueue.fulfill() is done with it. we're probably going to have to futz with some interfaces to fix this one; I'll poke around and come up with something.

Closing this one; it was a regression introduced in our first attempt to fix #394, which we rolled back a while ago and should stay fixed with that change.