The POSIX timedWait() implementation is based on getting the current wait clock time, converting it to a double, then converting it back into a timespec. It assumes that the timespec.tv_sec" field is a int, so it checks if the value if ">INT_MAX" and then waits forever. If one sets the system clock beyond 2038, then it will block forever. I hit this bug inside WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout() which gets call when receiving a mouse wheel event, but I'm sure one can hit it from other places too. Luckily for us, the timespec.tv_sec is not an int, but it's a time_t, which, since POSIX 2001 (and C11), has been defined as a 64 bit int. So we can just use the right checks and then it works! Proposed fix is: https://github.com/WebKit/WebKit/pull/3621
Pull request: https://github.com/WebKit/WebKit/pull/3621
Committed 253858@main (f63657fbf8c1): <https://commits.webkit.org/253858@main> Reviewed commits have been landed. Closing PR #3621 and removing active labels.
<rdar://problem/99221433>