Last Comment Bug 715471 - use fallible allocation for potentially large buffers in nsTextFrameThebes.cpp
: use fallible allocation for potentially large buffers in nsTextFrameThebes.cpp
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: Jonathan Kew (:jfkthame)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-05 04:26 PST by Jonathan Kew (:jfkthame)
Modified: 2012-01-16 04:56 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, use fallible arrays for large text buffers (10.90 KB, patch)
2012-01-12 04:56 PST, Jonathan Kew (:jfkthame)
roc: review+
Details | Diff | Review

Description Jonathan Kew (:jfkthame) 2012-01-05 04:26:20 PST
From bug 703100 comment 57:

We should review the existing buffer allocations in nsTextFrameThebes.cpp, and switch to fallible arrays in some cases where we're allocating space for a potentially huge string of text, and the code include checks for failure - it was clearly written assuming fallible arrays, but we've since changed the default behavior of arrays. The buffer passed to BuildTextRunForFrames, for example, should be allocated fallibly, as should the temporary buffer used when we need to "expand" 8- to 16-bit text. Basically, wherever we're doing "nsAutoTArray<T,BIG_TEXT_NODE_SIZE>", we probably want FallibleAutoTArray.
Comment 1 Jonathan Kew (:jfkthame) 2012-01-12 04:56:37 PST
Created attachment 588005 [details] [diff] [review]
patch, use fallible arrays for large text buffers
Comment 2 Ed Morley [:emorley] 2012-01-13 03:28:56 PST
Backed out of inbound for multiple test failures:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=148044813372

https://hg.mozilla.org/integration/mozilla-inbound/rev/7ee957b3e883
Comment 3 Jonathan Kew (:jfkthame) 2012-01-14 14:25:19 PST
Re-landed without the change to how BuildTextRunForFrames is called (it needs to be able to return null for the textrun without this being treated as failure):
https://hg.mozilla.org/integration/mozilla-inbound/rev/4117cd7064ee
Comment 4 Jonathan Kew (:jfkthame) 2012-01-16 04:56:00 PST
https://hg.mozilla.org/mozilla-central/rev/4117cd7064ee

Note You need to log in before you can comment on or make changes to this bug.