[Webkit-unassigned] [Bug 152045] New: std::chrono::duration casts are prone to overflows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 9 01:41:26 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=152045

            Bug ID: 152045
           Summary: std::chrono::duration casts are prone to overflows
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zan at falconsigh.net
                CC: darin at apple.com

Spun off from bug #144908
https://bugs.webkit.org/show_bug.cgi?id=144908

Casting between different std::chrono::duration specializations (e.g. seconds or milliseconds to microseconds) can easily result in an overflow of the duration value. In the worst-case scenario we can end up using a negative value to schedule platform-specific timers. In case of GLib, this can end up in continuous and immediate timer dispatches (bugs #144908 and #150930).

Current suggestions revolve around using clamping and/or overflow checks that could maybe be baked into a std::chrono::duration template specialization.

-- 
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/20151209/0de1f372/attachment.html>


More information about the webkit-unassigned mailing list