Skip to content

Panic gziping on .Get request #1014

Open
@hcoura

Description

@hcoura

I am getting sometimes a weird panic, during get requests, here is the stack trace stripped of company specific references, the trigger for this is a simple s.client.R().Get() that gets a gzipped response, my assumption is that at times this response is empty or broken and in someway triggering the nil pointer dereference

panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x662b99]
goroutine 104 [running]:
resty.dev/v3.(*Request).Execute.func1()
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/request.go:1368 +0xb5
panic({0xd456e0?, 0x164b9b0?})
/usr/local/go/src/runtime/panic.go:791 +0x132
compress/flate.(*decompressor).huffSym(0xc001b1b308, 0xc001b1bb60)
/usr/local/go/src/compress/flate/inflate.go:720 +0xf9
compress/flate.(*decompressor).huffmanBlock(0xc001b1b308?)
/usr/local/go/src/compress/flate/inflate.go:565 +0x405
compress/flate.(*decompressor).nextBlock(0xc001b1b308)
/usr/local/go/src/compress/flate/inflate.go:328 +0x178
compress/flate.(*decompressor).Read(0xc001b1b308, {0xc005ccc800, 0x200, 0xf198e8?})
/usr/local/go/src/compress/flate/inflate.go:348 +0x5b
compress/gzip.(*Reader).Read(0xc00df09b88, {0xc005ccc800, 0x200, 0x200})
/usr/local/go/src/compress/gzip/gunzip.go:252 +0xa2
resty.dev/v3.(*gzipReader).Read(0x0?, {0xc005ccc800?, 0xc0052471a0?, 0x46ffa9?})
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/stream.go:98 +0x1c
resty.dev/v3.(*limitReadCloser).Read(0xc009b905a0, {0xc005ccc800?, 0x9e1c51?, 0xc000073508?})
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/stream.go:145 +0xa2
io.ReadAll({0x7f2310dfa6f0, 0xc009b905a0})
/usr/local/go/src/io/io.go:712 +0x7e
resty.dev/v3.(*Response).readAll(0xc00e32bb90)
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/response.go:238 +0x94
resty.dev/v3.(*Response).readIfRequired(...)
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/response.go:222
resty.dev/v3.(*Response).String(0xc00e32bb90)
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/response.go:104 +0x2c
...
resty.dev/v3.(*Request).Execute(0xc00dac5b88, {0xe9e1fb?, 0x1?}, {0xedd8be, 0x43})
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/request.go:1429 +0xb19
resty.dev/v3.(*Request).Get(...)
/go/pkg/mod/resty.dev/v3@v3.0.0-beta.2/request.go:1293
...

I don't have an easy way to repro as it's not happening that often, but it's triggering annoying server restarts, figured I would report and in case you have seen it before I would appreciate any pointers.

I will probably try to downgrade to v2 next week and see if it happens there too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions