Closed Bug 1655917 Opened 4 years ago Closed 4 years ago

Nuking a CCW to a WeakRef clears the target of the WeakRef

Categories

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

defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- wontfix
firefox80 --- wontfix
firefox81 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

As reported by loganfsmyth:

var g = newGlobal({ newCompartment: true });
g.eval(`
  var obj = {};
  var ref = new WeakRef(obj);
  Promise.resolve().then(() => {
    print(obj);
    print(ref.deref());
  });
`);
nukeCCW(g.ref);

Prints:

[object Object]
undefined

This was indisciminate before. We only want to do this when it's a CCW that's used by the WeakRef implementation that gets nuked.

Set release status flags based on info from the regressing bug 1644985

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/52f23f1d2acf Fix clearing WeakRef target when CCWs to the WeakRef are nuked r=sfink
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch

The patch landed in nightly and beta is affected.
:jonco, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jcoppeard)

I think it's unlikely that there is still script running in compartments after we have nuked the CCWs to them and therefore this bug is unlikely to affect users. Let's let this ride the trains unless there's any evidence to the contrary.

Flags: needinfo?(jcoppeard)
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: