Closed Bug 1600019 Opened 6 years ago Closed 6 years ago

Missing OOM handling in registerWithFinalizationGroup and uninitialised FinalizationRecordVectorObject when tracing

Categories

(Core :: JavaScript: GC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(5 files)

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

let group = new FinalizationGroup(x => 0);
let target = {};
let token = {};
oomTest(() => group.register(target, 1, token));

This test case asserts with Assertion failure: isDouble():

enableShellAllocationMetadataBuilder();
evaluate(`
  var group = new FinalizationGroup(x => 0);
  gczeal(9,3);
  group.register({}, 1, {});
`);

NewObjectWithClassProto when called with a non-null prototype calls NewObjectWithGivenTaggedProto,
but that function can be called more directly through NewObjectWithGivenProto.

Depends on D55087

js::Call avoids copying the arguments into a separate InvokeArgs struct,
therefore it's generally preferred for calls within SpiderMonkey.

Depends on D55088

Priority: -- → P1
Pushed by dluca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/889b0858a957 Part 1: Handle OOM in registerWithFinalizationGroup. r=jonco https://hg.mozilla.org/integration/autoland/rev/ad0a7949dd8e Part 2: Handle the case when FinalizationRecordVectorObject's records slot is uninitialised. r=jonco https://hg.mozilla.org/integration/autoland/rev/bc921ac2bd1b Part 3: Use NewObjectWithGivenProto when |prototype| argument is guaranteed to be non-null. r=jonco https://hg.mozilla.org/integration/autoland/rev/3de775ee7d0e Part 4: Prefer js::Call over JS::Call for engine-internal calls. r=jonco https://hg.mozilla.org/integration/autoland/rev/273f738dab5f Part 5: Avoid rooting a handle-value. r=jonco
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: