GAPIS box.go serialization has limits on the size of the struct.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
Requesting something huge, like the entire state object via `service.Get(cmd.StateAfter())`, will cause the server to panic as it tries to serialize the large struct. The panic happens when [box.go](https://github.com/google/gapid/blob/d911080866a1fd42e2aa2b208d441b0b6e183d0b/gapis/service/box/box.go#L383) calls `reflect.StructOf` with a struct that is too big:
```
panic: reflect.nameFrom: name too long: struct { <... lots of stuff ...> }
reflect.newName(0xc420e7e000, 0x1f428, 0x0, 0x0, 0x0, 0x1f400)
GOROOT/src/reflect/type.go:539 +0x31e
reflect.StructOf(0xc4202bcf00, 0xc, 0xc, 0x0, 0x0)
GOROOT/src/reflect/type.go:2690 +0x2094
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420bd2aa0, 0x0, 0x0)
gapis/service/box/box.go:396 +0x366
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420bd2a80, 0x0, 0x0)
gapis/service/box/box.go:387 +0x659
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420bbec00, 0x0, 0x0)
gapis/service/box/box.go:393 +0x24b
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420c30140, 0x0, 0x0)
gapis/service/box/box.go:393 +0x24b
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420c30120, 0x0, 0x0)
gapis/service/box/box.go:387 +0x659
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420c300e0, 0x0, 0x0)
gapis/service/box/box.go:399 +0x549
github.com/google/gapid/gapis/service/box.(*unboxer).ty(0xc420bd19d0, 0xc420c30080, 0x0, 0x0)
gapis/service/box/box.go:393 +0x24b
github.com/google/gapid/gapis/service/box.(*unboxer).val(0xc420bd19d0, 0xc420c30040, 0x0, 0x0, 0x0)
gapis/service/box/box.go:335 +0x746
github.com/google/gapid/gapis/service/box.(*unboxer).val(0xc420bd19d0, 0xc420c30020, 0x0, 0x0, 0x0)
gapis/service/box/box.go:310 +0x564
github.com/google/gapid/gapis/service/box.(*Value).Get(0xc420c30020, 0x0, 0x0)
gapis/service/box/box.go:42 +0x5d
github.com/google/gapid/gapis/service.(*Value).Get(0xc420bb6000, 0x7fb6a4ebda98, 0xc42070a2a0)
gapis/service/service.go:242 +0x8e
github.com/google/gapid/gapis/client.(*client).Get(0xc42023ff60, 0x2fefb40, 0xc42070a2a0, 0xc42001bfc0, 0xc42070a2a0, 0xc420874540, 0x302ae20, 0x2a98f60)
gapis/client/client.go:93 +0x143
```
Contributor guide
Assessment
This issue has not been assessed yet.