Closed Bug 1280436 Opened 8 years ago Closed 8 years ago

Break reference cycle that results in memory leak

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1280762
Tracking Status
firefox50 --- affected

People

(Reporter: kats, Unassigned)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

From bug 1261166 comment 22:

I discovered that there's a cyclical reference which is probably causing the leak.

LayerTransactionParent holds a RefPtr to LayerManagerComposite
LayerManagerComposite holds a RefPtr to CompositorOGL
Compositor holds a bunch of ShmemTextureReadLock instances in mUnlockAfterComposition
The ShmemTextureReadLock instances hold RefPtrs to LayerTransactionParent

(There's a bit more context in that bug).
Blocks: 1272600
So bug 1176011 didn't fix the crash that's introduced by this patch. Sotaro, do you have any other ideas on what could be going on here? The exact steps to reproduce the crash:

1) Start with current mozilla-central (on OS X)
2) Apply attachment 8763604 [details] [diff] [review] (from bug 1261166)
3) Apply attachment 8763075 [details] [diff] [review] (from this bug)
4) Do a debug build
5) Run ./mach mochitest -f plain --keep-open=false --setpref gfx.use-iosurface-textures=true gfx/layers/apz/test/mochitest/

The test runs but then it crashes on shutdown. If you skip step 3, you will get leaks on shutdown instead.
Flags: needinfo?(sotaro.ikeda.g)
Whiteboard: [gfx-noted]
I am going to check it.
Flags: needinfo?(sotaro.ikeda.g)
See Also: → 1280762
Flags: needinfo?(sotaro.ikeda.g)
I am still waiting the debug build complete, but I seems to understand a cause of the crash. A peer of CompositorBridgeChild could be CrossProcessCompositorBridgeParent. Compositor::Destroy() is related to only to CompositorBridgeParent. When CrossProcessCompositorBridgeParent is destroyed, related Shmem also have to be destroyed and untouched after the destroy.
Flags: needinfo?(sotaro.ikeda.g)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #2)
> So bug 1176011 didn't fix the crash that's introduced by this patch. Sotaro,
> do you have any other ideas on what could be going on here? The exact steps
> to reproduce the crash:
> 
> 1) Start with current mozilla-central (on OS X)
> 2) Apply attachment 8763604 [details] [diff] [review] (from bug 1261166)
> 3) Apply attachment 8763075 [details] [diff] [review] (from this bug)
> 4) Do a debug build
> 5) Run ./mach mochitest -f plain --keep-open=false --setpref
> gfx.use-iosurface-textures=true gfx/layers/apz/test/mochitest/
> 
> The test runs but then it crashes on shutdown. If you skip step 3, you will
> get leaks on shutdown instead.

I tried several times, but I failed to reproduce the crash. :kats, can you try a patch in Bug 1280762?
Flags: needinfo?(bugmail.mozilla)
(In reply to Sotaro Ikeda [:sotaro] from comment #5)
> I tried several times, but I failed to reproduce the crash.

Note that it only happens on OS X.

> :kats, can you
> try a patch in Bug 1280762?

That patch seems to fix the issue! I used that patch instead of the one on this bug, since it looks like that already incorporates the changes from this bug.
Flags: needinfo?(bugmail.mozilla)
This seems like it's effectively a dupe of bug 1280762, so I'll close it as such.
No longer blocks: 1261166, 1272600
Status: NEW → RESOLVED
Closed: 8 years ago
No longer depends on: 1176011
Resolution: --- → DUPLICATE
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #6)
> (In reply to Sotaro Ikeda [:sotaro] from comment #5)
> > I tried several times, but I failed to reproduce the crash.
> 
> Note that it only happens on OS X.

Yes, I checked on OS X.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: