Skip to content

Panic gziping on .Get request #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hcoura opened this issue Apr 26, 2025 · 1 comment
Open

Panic gziping on .Get request #1014

hcoura opened this issue Apr 26, 2025 · 1 comment

Comments

@hcoura
Copy link

hcoura commented Apr 26, 2025

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

@jeevatkm
Copy link
Member

@hcoura Thanks for reporting it. I will analyze and figure it out.

@jeevatkm jeevatkm added this to the v3.0.0 Milestone milestone May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants