Closed Bug 1245552 Opened 5 years ago Closed 5 years ago

crash in OOM | large | mozalloc_abort | mozalloc_handle_oom | moz_xmalloc | mozilla::gl::TexSubImage2DHelper

Categories

(Core :: Graphics, defect)

Unspecified
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox44 --- affected
firefox45 --- affected
firefox46 --- affected
firefox47 --- affected
firefox48 --- fixed
fennec 45+ ---

People

(Reporter: snorp, Assigned: sotaro)

References

Details

(Keywords: crash)

Crash Data

Attachments

(2 files, 4 obsolete files)

This bug was filed from the Socorro interface and is 
report bp-d7d008ec-af8e-4405-8086-924372160131.
=============================================================

Here is a OOM when we're trying to upload a giant (24MB in this case) texture. Probably a good place to look at for gfx OOM in general.
The allocation that seems to be OOMing is in TexSubImage2DWithoutUnpackSubimage, where we allocate and copy the entire texture. I guess the main question here is why do we have a 24MB texture in the first place? At upload time in this scenario we will require 3x that amount: once for original data, once for the copy here in TexSubImage2DWithoutUnpackSubimage, and presumably one more for the texture itself. That's a lot, though we will throw at least one of those copies away immediately.
Sotaro, can you see if there is a better way to deal with such large requests?
Assignee: nobody → sotaro.ikeda.g
tracking-fennec: ? → 45+
a testcase is created by modifying attachment 8584779 [details] of Bug 1148582. It created a very large mask layer.
MaskLayer is created by ContainerState::CreateMaskLayer().
 https://dxr.mozilla.org/mozilla-central/source/layout/base/FrameLayerBuilder.cpp#5975

MaskLayer data is stored as SourceSurfaceImage. SourceSurfaceImage::GetTextureClient() allocates duplicated memory as TextureClient. It seems better to avoid to allocate duplicated memory if possible.
  https://dxr.mozilla.org/mozilla-central/source/gfx/layers/ImageContainer.cpp#563
Bug 1252405 is created for Comment 4.
(In reply to Sotaro Ikeda [:sotaro] from comment #7)
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=c3aa0d6e13d3

The patch seemed to cause some test failures.
Attachment #8726628 - Attachment is obsolete: true
Attachment #8727851 - Attachment is obsolete: true
Jeff recommended to allocate a mask as to aligned to 4 byte as a short term solution.
Attachment #8727866 - Attachment is obsolete: true
Add fuzz to tests.
Attachment #8728221 - Attachment is obsolete: true
Attachment #8730058 - Flags: review?(matt.woodrow)
Attachment #8730058 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/85f0d8ad266f
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Depends on: 1289829
You need to log in before you can comment on or make changes to this bug.