[Webkit-unassigned] [Bug 157937] New: WTF::Condition::waitFor() will time out immediately for relativeTimeout values with very large tick counts
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 19 17:53:56 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=157937
Bug ID: 157937
Summary: WTF::Condition::waitFor() will time out immediately
for relativeTimeout values with very large tick counts
Classification: Unclassified
Product: WebKit
Version: WebKit Nightly Build
Hardware: All
OS: All
Status: NEW
Severity: Major
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: aestes at apple.com
As discussed in <https://bugs.webkit.org/show_bug.cgi?id=157924>, WTF::Condition::waitFor() times out immediately if given a relativeTimeout of std::chrono::milliseconds::max(), due to two signed integer overflow bugs conspiring against us in Condition::absoluteFromRelative().
The first happens in this comparison:
if (relativeTimeout > Clock::duration::max()) {
std::chrono::duration converts the operands of its inequality operators to the type common to both durations (using std::common_type) before performing the comparison. In this case that's nanoseconds, and converting milliseconds::max() to nanoseconds will overflow since they both use the same underlying data type.
The second happens on this line, for the same reason, except this time the conversion is explicit:
Clock::duration myRelativeTimeout =
std::chrono::duration_cast<Clock::duration>(relativeTimeout);
Since the check that was supposed to protect us from overflowing itself overflowed, we now have a negative relative timeout.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160520/8f5a588d/attachment-0001.html>
More information about the webkit-unassigned
mailing list