Closed Bug 1174151 Opened 6 years ago Closed 6 years ago

Large OOM in mozilla::WebGLTexture::EnsureNoUninitializedImageData

Categories

(Core :: Canvas: WebGL, defect)

39 Branch
x86
Windows 7
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Tracking Status
firefox39 --- affected

People

(Reporter: cbadau, Assigned: kyle_fung)

References

Details

(Keywords: crash, Whiteboard: gfx-noted)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-85a7869e-1bec-4b58-83e4-df4882150612.
=============================================================

I had several sites opened: Youtube, Facebook, Google Maps. I navigated on those sites -> crash occurs.

I don't have proper STR.
Crash Signature: [@ OOM | large | mozalloc_abort(char const* const) | mozalloc_handle_oom(unsigned int) | moz_xcalloc | mozilla::WebGLTexture::EnsureNoUninitializedImageData(StrongGLenum<T>, int)] → [@ OOM | large | mozalloc_abort(char const* const) | mozalloc_handle_oom(unsigned int) | moz_xcalloc | mozilla::WebGLTexture::EnsureNoUninitializedImageData(StrongGLenum<T>, int)] [@ OOM | large | mozalloc_abort | mozalloc_handle_oom | moz_xcalloc | mozi…
Summary: crash in OOM | large | mozalloc_abort(char const* const) | mozalloc_handle_oom(unsigned int) | moz_xcalloc | mozilla::WebGLTexture::EnsureNoUninitializedImageData(StrongGLenum<T>, int) → Large OOM in mozilla::WebGLTexture::EnsureNoUninitializedImageData
Looking through the reports, they seem to be all 1.5-16M allocations, many of them 2M or 4M, Google Maps is also mentioned in comments.
https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.cpp#656
"// Infallible for now."

Can that be changed?
Flags: needinfo?(dglastonbury)
Whiteboard: gfx-noted
(In reply to David Major [:dmajor] from comment #2)
> https://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLTexture.
> cpp#656
> "// Infallible for now."
> 
> Can that be changed?

How about something like the attached patch?

https://treeherder.mozilla.org/#/jobs?repo=try&revision=a55a8214cdb2
Flags: needinfo?(dglastonbury)
Assignee: nobody → dglastonbury
Comment on attachment 8622811 [details] [diff] [review]
Use fallible allocation when clearing texture on first use.

Review of attachment 8622811 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLTexture.cpp
@@ +663,5 @@
> +                                   level);
> +         return false;
> +    }
> +
> +    memset(zeros.get(), 0, byteCount);

Just use moz_calloc, since that's the fallible version of moz_xcalloc. We want those mmap'd zero pages!
Attachment #8622811 - Flags: review?(jgilbert) → review-
Kyle, I spoke with Milan and since he assigned bug 1151736 to you and this bug is related to that one, I'm assigning this to you.

Please update the patch with Jeff's review comments.

This patch fixes one source of OOM at the point of allocating a buffer to hold temporary texture data. It's possible for the texImage upload to fail with OOM too.
Assignee: dglastonbury → kfung
Depends on: 1151736
Bug 1151736 is resolved, so I'm closing this bug too
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.