Closed Bug 1640475 Opened 5 years ago Closed 5 years ago

Missing OOM handling after js_malloc in RegExpShared::initializeNamedCaptures

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: anba, Assigned: iain)

References

Details

Attachments

(1 file)

Test case:

var i = 0;
oomTest(function() {
    for (var j = 0; j < 10; ++j) {
        var r = RegExp(`(?<_${(i++).toString(32)}>a)`);
        r.exec("a");
    }
});

Asserts with:

Assertion failure: cx->isExceptionPending() (Thunk execution failed but no exception was raised - missing call to js::ReportOutOfMemory()?)

Reason:
OOM after js_malloc not handled in RegExpShared::initializeNamedCaptures.

Iain, could you look at this bug

Severity: -- → S3
Flags: needinfo?(iireland)
Priority: -- → P2
Assignee: nobody → iireland
Status: NEW → ASSIGNED
Flags: needinfo?(iireland)
Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b4c531b04559 Report OOM in initializeNamedCaptures r=mgaudet

Forgot to make the testcase conditional on oomTest being defined.

Flags: needinfo?(iireland)
Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08de9180d90c Report OOM in initializeNamedCaptures r=mgaudet
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: