Closed Bug 1285238 Opened 4 years ago Closed 3 years ago

Intermittent LeakSanitizer | leak at mozilla::layers::BufferTextureData::CreateInternal, mozilla::layers::BufferTextureData::CreateForYCbCr, mozilla::layers::TextureClient::CreateForYCbCr, mozilla::layers::YCbCrTextureClientAllocationHelper::Allocate


(Core :: Graphics: Layers, defect)

Not set



Tracking Status
firefox50 --- fixed


(Reporter: intermittent-bug-filer, Assigned: sotaro, NeedInfo)


(Keywords: intermittent-failure, memory-leak, Whiteboard: [gfx-noted])


(1 file)

Keywords: mlk
This looks like there's a race condition during shutdown causing this leak. Nical, is there anything we can do on our side about this? (See the log's gfxCriticalError)
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(matt.woodrow)
Whiteboard: [gfx-noted]
We already try to mitigate this type of situation by forcing all textures to be destroyed synchronously when shutting down our ipdl protocols. Doing that is not race-free unfortunately, and making that completely race-free is hard, so it can happen that textures fall through the cracks and don't get destroyed syncrhonously with the ImageBridge. The issue here is that the destruction of the texture is happening very late when the ImageBridge thread itself (not just the protocols) is already gone. Papering over this is hard. The most sensible way to fix this is to identify what is releasing the texture so late and make sure it is cleaned up during media or gfx's shutdown. Unfortunately there is no stack for the gfxCriticalError in the log so I my guess would be to start looking at the TextureClientRecycleAllocator that was added recently-ish and may not be dealing with shutdown explicitly.
Flags: needinfo?(nical.bugzilla)
Sotaro, is there an explicit mechanism to make sure the recycling mechanism for video texture is shut down before the gfx IPDL protocols? In particular I am looking at CompositableClient::mTextureClientRecycler which seems to rely only on reference counting and it is probably not enough to have the recycler reliably cleaned up in time.
Flags: needinfo?(sotaro.ikeda.g)
(In reply to Nicolas Silva [:nical] from comment #3)
> Sotaro, is there an explicit mechanism to make sure the recycling mechanism
> for video texture is shut down before the gfx IPDL protocols?

There is not explicit mechanism now. I am going to add it.
Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)
Attachment #8770784 - Flags: review?(nical.bugzilla)
Attachment #8770784 - Flags: review?(nical.bugzilla) → review+
Pushed by
Add TextureClientRecycleAllocator::Destroy() r=nical
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.