Bug 223532 - Uncaught Exception: RangeError: Array size is not a small enough positive integer.
Summary: Uncaught Exception: RangeError: Array size is not a small enough positive int...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL: favorites://
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-19 12:34 PDT by BJ Burg
Modified: 2021-03-19 14:22 PDT (History)
5 users (show)

See Also:


Attachments
Patch v1.0 (2.33 KB, patch)
2021-03-19 14:12 PDT, BJ Burg
hi: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2021-03-19 12:34:34 PDT
Uncaught Exception in Web Inspector.

Steps to Reproduce:
1. Timelines Tab > Start Recording
2. Export / Save Recording
3. Load saved recording
4. Select CPU instrument

=> uncaught exception

Uncaught Exceptions:
-----------------------
 - RangeError: Array size is not a small enough positive integer. (at CPUTimelineView.js:1274:32)
    _computeStatisticsData @ CPUTimelineView.js:1274:32
    layout @ CPUTimelineView.js:459:59
    _layoutSubtree @ View.js:293:20
    updateLayout @ View.js:159:28
    showTimelineViewForTimeline @ TimelineRecordingContentView.js:153:37
    _timelineSelected @ TimelineRecordingContentView.js:799:45
    dispatch @ Object.js:129:35
    dispatchEventToListeners @ Object.js:137:17
    _timelinesTreeSelectionDidChange @ TimelineOverview.js:896:38
    dispatch @ Object.js:129:35
    dispatchEventToListeners @ Object.js:137:17
    _dispatchSelectionDidChangeEvent @ TreeOutline.js:1083:38
    selectionControllerSelectionDidChange @ TreeOutline.js:755:46
    _updateSelectedItems @ SelectionController.js:458:65
    selectItem @ SelectionController.js:155:34
    handleItemMouseDown @ SelectionController.js:322:28
    _handleMouseDown @ TreeOutline.js:1067:54
    _handleMouseDown @ [native code]
-----------------------

Notes:
Inspected URL:        favorites://
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
Comment 1 BJ Burg 2021-03-19 12:39:02 PDT
Relevant code: 

        let millisecondStartTime = Math.round(startTime * 1000);
        let millisecondEndTime = Math.round(endTime * 1000);
        let millisecondDuration = millisecondEndTime - millisecondStartTime;

        let samples = new Array(millisecondDuration);

For some reason `endTime` is 0 here, so the overall duration is negative and the Array constructor throws.
Comment 2 Radar WebKit Bug Importer 2021-03-19 13:55:19 PDT
<rdar://problem/75635080>
Comment 3 BJ Burg 2021-03-19 14:12:03 PDT
Created attachment 423776 [details]
Patch v1.0
Comment 4 Devin Rousso 2021-03-19 14:14:44 PDT
Comment on attachment 423776 [details]
Patch v1.0

rs=me
Comment 5 BJ Burg 2021-03-19 14:22:17 PDT
Committed r274737 (235555@main): <https://commits.webkit.org/235555@main>