WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
244302
POSIX implementation of ThreadCondition::timedWait() degenerates to wait() beyond 2038
https://bugs.webkit.org/show_bug.cgi?id=244302
Summary
POSIX implementation of ThreadCondition::timedWait() degenerates to wait() be...
Olivier Crête
Reported
2022-08-24 12:57:50 PDT
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
Attachments
Add attachment
proposed patch, testcase, etc.
Olivier Crête
Comment 1
2022-08-24 13:02:58 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/3621
EWS
Comment 2
2022-08-27 01:33:10 PDT
Committed
253858@main
(f63657fbf8c1): <
https://commits.webkit.org/253858@main
> Reviewed commits have been landed. Closing PR #3621 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2022-08-27 01:34:16 PDT
<
rdar://problem/99221433
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug