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

poll: Use GetTickCount64 to avoid wraparound issues #1003

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

shoelzer
Copy link

@shoelzer shoelzer commented Dec 19, 2016

This replaces PR #993. I was doing that one with the GitHub website but
can't complete it there.

Note that @linquize, @PhilipOakley, and @dscho were having a discussion
about Win XP support and that should conclude before accepting this PR.

From Visual Studio 2015 Code Analysis: Warning C28159 Consider using
'GetTickCount64' instead of 'GetTickCount'.

Reason: GetTickCount overflows roughly every 49 days. Code that does not
take that into account can loop indefinitely. GetTickCount64 operates on
64 bit values and does not have that problem.

Signed-off-by: Steve Hoelzer [email protected]

From Visual Studio 2015 Code Analysis: Warning C28159 Consider using
'GetTickCount64' instead of 'GetTickCount'.

Reason: GetTickCount overflows roughly every 49 days. Code that does not
take that into account can loop indefinitely. GetTickCount64 operates on
64 bit values and does not have that problem.

Signed-off-by: Steve Hoelzer <[email protected]>
@dscho
Copy link
Member

dscho commented Dec 20, 2016

This replaces PR #993. I was doing that one with the GitHub website but
can't complete it there.

Please note that GitHub created the patch-1 branch in your repository, and you can update the original Pull Request by checking out that branch, modifying it and force-pushing it back.

As to XP support: I will merge this for now, and help @linquize to get XP support back if my question ("Are you this developer?") is answered in the affirmative.

@dscho dscho merged commit 7db5cb8 into git-for-windows:master Dec 20, 2016
@shoelzer
Copy link
Author

@dscho Thanks for the tip. I'm still figuring out GitHub.

@dscho
Copy link
Member

dscho commented Dec 22, 2016

@shoelzer no worries.

@linquize I ended up having to add the XP compatibility patch anyways: 8b018c7 (it was necessary because we did not quite yet make the jump away from XP in Git for Windows' source code). It would be good of you if you could react to my comments, otherwise it really feels as if I was talking to your hand.

@dscho dscho modified the milestone: v2.11.1 Dec 22, 2016
dscho added a commit to git-for-windows/build-extra that referenced this pull request Dec 23, 2016
Our `poll()` emulation [now uses 64-bit tick
counts](git-for-windows/git#1003) to avoid
the (very rare) wraparound issue where it could miscalculate time
differences every 49 days.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Jan 11, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 18, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 18, 2017
poll: Use GetTickCount64 to avoid wraparound issues
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
poll: Use GetTickCount64 to avoid wraparound issues
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
poll: Use GetTickCount64 to avoid wraparound issues
git-for-windows-ci pushed a commit that referenced this pull request Jan 18, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 24, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 24, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 24, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 25, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 25, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 25, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Jan 25, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit to dscho/git that referenced this pull request Feb 1, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Feb 2, 2017
poll: Use GetTickCount64 to avoid wraparound issues
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Feb 2, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit that referenced this pull request Feb 2, 2017
poll: Use GetTickCount64 to avoid wraparound issues
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
poll: Use GetTickCount64 to avoid wraparound issues
dscho added a commit to dscho/git that referenced this pull request Feb 21, 2019
This was pull request git-for-windows#1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 22, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 22, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 23, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 23, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Feb 24, 2019
This was pull request git-for-windows#1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 28, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 28, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this pull request Feb 28, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Feb 28, 2019
This was pull request #1003 from shoelzer/master

poll: Use GetTickCount64 to avoid wraparound issues
Signed-off-by: Johannes Schindelin <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants