Skip to content
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

errNoAvailableYet wait mechanism doesn't work(got panic) #33

Open
Allyin opened this issue Feb 20, 2024 · 0 comments
Open

errNoAvailableYet wait mechanism doesn't work(got panic) #33

Allyin opened this issue Feb 20, 2024 · 0 comments

Comments

@Allyin
Copy link

Allyin commented Feb 20, 2024

Hello.

In my knowledge, errNoAvailableYet occur when the the time of the current package is large than (T-59m).

This will definitely happen because the seed generation time is 1 minute, but the polling time is 20s.
image

When the time occurs, code should wait for the seed to be generated, but the program will panic directly.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xee9164]

goroutine 117 [running]:
github.com/VirusTotal/vt-go.(*Feed).getObjects(0xc000410e00, 0xc013b3ce70, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:189 +0x684
github.com/VirusTotal/vt-go.(*Feed).retrieve(0xc000410e00)
        /root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:227 +0xaa
created by github.com/VirusTotal/vt-go.(*Client).NewFeed
        /root/go/pkg/mod/github.com/!virus!total/[email protected]/feed.go:126 +0x22a

I analyzed this problem, bug arises from the error return of parseResponse.
image

This 400 resp'Content-Type is application/json,but the error used gzip, and then returned a nil Response.
image

image

use any time of the current package which large than (T-59m) can reproduce this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant