Bug 261624 - segmentation benchmark in JetStream 2 is not guaranteed to complete
Summary: segmentation benchmark in JetStream 2 is not guaranteed to complete
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-15 15:02 PDT by Seth Brenith
Modified: 2023-09-22 15:03 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>