Bug 261624

Summary: segmentation benchmark in JetStream 2 is not guaranteed to complete
Product: WebKit Reporter: Seth Brenith <sethbrenith>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Minor CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Seth Brenith 2023-09-15 15:02:20 PDT
In the Microsoft performance lab, we've occasionally observed cases where JetStream 2 didn't complete and was stuck on the "segmentation" benchmark. We've only observed this on 13th gen Intel processors, but it seems to be due to a race condition in the JS code. The console shows two errors:

    Uncaught TypeError: AsyncTaskWorker._queue.pop(...) in segmentation.js:542, is not a fucntion at segmentation.js:542:49
    Uncaught (in promise) Uncaught TypeError: AsyncTaskWorker._queue.pop(...) is not a function in JetStreamDriver.js:208

Here is a snippet of code from near segmentation.js:542:

    setTimeout(function () {
        var worker = AsyncTaskWorker._findAvailableWorker();
        if (worker)
            AsyncTaskWorker._queue.pop()(worker);
    }, 50);

This function attempts to find an available worker and set it to work. However, there is no guarantee that AsyncTaskWorker._queue is nonempty, so it is possible that .pop() returns undefined. This unhandled error would be harmless, except that JetStreamDriver.js attached a global exception handler:

    window.onerror = top.currentReject;

The currentReject function rejects the Promise for the current benchmark, which prevents completion.
Comment 1 Radar WebKit Bug Importer 2023-09-22 15:03:14 PDT
<rdar://problem/115911436>