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

cmd/link: suspicious use of (*cmd/internal/bio/buf.Reader).Seek #28556

Open
alandonovan opened this issue Nov 2, 2018 · 3 comments
Open

cmd/link: suspicious use of (*cmd/internal/bio/buf.Reader).Seek #28556

alandonovan opened this issue Nov 2, 2018 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@alandonovan
Copy link
Contributor

While a running a recent test of vet, it flagged the (*buf.Reader).Seek method as not having a proper return type (int64, error). Instead it handles errors by calling log.Fatal, yet most callers of this function seem to assume it returns a negative number to indicate failure.

Someone who knows this code should probably audit it.

@bradfitz bradfitz added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 2, 2018
@bradfitz bradfitz added this to the Unplanned milestone Nov 2, 2018
@bradfitz
Copy link
Contributor

bradfitz commented Nov 2, 2018

I remember some clean-ups some time ago to move towards using the stdlib types. I assume the old seeker was C-ish and returned negative and we didn't convert it all when moving to Go stuff.

/cc @davecheney

@alexyak1
Copy link

Fix here https://go-review.googlesource.com/c/go/+/151043. On review now

@gopherbot
Copy link

Change https://golang.org/cl/151043 mentions this issue: math: Fix suspicious use of (*cmd/internal/bio/buf.Reader).Seek

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants