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

net, internal/poll: kernelVersion helper miscalculates minor version component #42733

Closed
dmitshur opened this issue Nov 19, 2020 · 2 comments
Closed

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Nov 19, 2020

In kernelVersion, after reaching the end of the major version component, the accumulated value is used. But it isn't reset to zero after, so the minor version component computation is polluted.

This can be reproduced on the playground, see https://play.golang.org/p/U8-OWl-gzR4.

The fix is to add one line:

value = 0

Both copies of kernelVersion helper were introduced recently and can be fixed in time for Go 1.16.

CC @cuonglm, @ianlancetaylor.

@dmitshur dmitshur added this to the Go1.16 milestone Nov 19, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 20, 2020

Thanks for noticing.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 20, 2020

Change https://golang.org/cl/271846 mentions this issue: net, internal/poll: reset value before adding in minor kernel version

@gopherbot gopherbot closed this in 66c0264 Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.