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

Attempt to fix 2038 problem with MSVC #1078

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Conversation

botovq
Copy link
Contributor

@botovq botovq commented Aug 2, 2024

This might fix #1076

@datadiode
Copy link

You may want to wrap winsock select() as well to ensure that it will still see the timeval struct layout it expects.

@LainOTN2
Copy link

LainOTN2 commented Aug 6, 2024

Tested on OpenSSH portable, and it fixes the issues on Win32 builds.

@botovq
Copy link
Contributor Author

botovq commented Aug 6, 2024 via email

botovq and others added 3 commits October 6, 2024 18:56
Otherwise it sets looptime to -1, which was skipped by select()
and caused 100% cpu busy looping.
This prevents the compatibility struct timeval definition in
sys/time.h from potentially getting used with select() here.

https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select
@busterb
Copy link
Contributor

busterb commented Oct 7, 2024

I made a change to poll_win.c to ensure that we use the appropriate timeval definition with select with Windows. We were anyway, because sys/time.h isn't used in Windows' select definition, but still just in case.

This also fixes an issue where select was given {0, 4294967296} when poll was given a timeout value of -1, which caused poll() to spin with no timeout internally, noticed while logging internal behavior with openssl s_client.

@busterb
Copy link
Contributor

busterb commented Oct 8, 2024

Going to land this now

@busterb busterb merged commit 64f15ec into libressl:master Oct 8, 2024
47 checks passed
@botovq
Copy link
Contributor Author

botovq commented Oct 8, 2024 via email

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.

gettimeofday implementation for MSVC cannot handle dates beyond 2038
4 participants