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

dmitshur opened this issue Nov 19, 2020 · 2 comments


Copy link

@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

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
Copy link

@ianlancetaylor ianlancetaylor commented Nov 20, 2020

Thanks for noticing.

Copy link

@gopherbot gopherbot commented Nov 20, 2020

Change 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
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.