Bug 219418 - Fix crash with performance.measure() with negative duration
Summary: Fix crash with performance.measure() with negative duration
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-01 18:11 PST by Julian Gonzalez
Modified: 2020-12-03 15:33 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.79 KB, patch)
2020-12-01 18:18 PST, Julian Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Gonzalez 2020-12-01 18:11:24 PST
If the `duration` field passed to performance.measure() is negative, we expect to throw an Exception.
However, due to a typo in PerformanceUserTiming::measure() we actually crash.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebCore                   0x000000014e15f23b WTFCrashWithInfo(int, char const*, char const*, int) + 27 (Assertions.h:671)
1   com.apple.WebCore                   0x000000014e219500 std::experimental::fundamentals_v3::__expected_detail::__expected_terminate() + 48 (Expected.h:231)
2   com.apple.WebCore                   0x000000014fab6cd6 std::experimental::fundamentals_v3::expected<double, WebCore::Exception>::error() & + 70 (Expected.h:497)
3   com.apple.WebCore                   0x000000014fab6c21 WebCore::ExceptionOr<double>::releaseException() + 17 (ExceptionOr.h:124)
4   com.apple.WebCore                   0x0000000152a640a9 WebCore::PerformanceUserTiming::measure(JSC::JSGlobalObject&, WTF::String const&, WebCore::PerformanceMeasureOptions const&) + 2057 (PerformanceUserTiming.cpp:214)
5   com.apple.WebCore                   0x0000000152a7d28e WebCore::PerformanceUserTiming::measure(JSC::JSGlobalObject&, WTF::String const&, WTF::Optional<WTF::Variant<WTF::String, WebCore::PerformanceMeasureOptions> >&&, WTF::String const&)::$_1::operator()(WebCore::PerformanceMeasureOptions const&) const + 670 (PerformanceUserTiming.cpp:273)


<rdar://problem/71238176>
Comment 1 Julian Gonzalez 2020-12-01 18:18:02 PST
Created attachment 415181 [details]
Patch
Comment 2 EWS 2020-12-02 11:07:38 PST
Committed r270355: <https://trac.webkit.org/changeset/270355>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415181 [details].