Closed Bug 1258498 Opened 4 years ago Closed 4 years ago

crash in OOM | large | NS_ABORT_OOM | nsACString_internal::SetCapacity

Categories

(Core :: XPCOM, defect, critical)

x86
Windows NT
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: khuey, Unassigned)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Attached patch PatchSplinter Review
This bug was filed from the Socorro interface and is 
report bp-0a1eb6e8-f2e0-4a83-993b-79cab2160321.
=============================================================

Socorro (and Visual Studio) are missing several stack frames here.  The SetCapacity call is at http://hg.mozilla.org/mozilla-central/annotate/4037eb98974d/xpcom/io/nsScriptableInputStream.cpp#l84.  It should just be fallible.
Attachment #8733016 - Flags: review?(nfroyd)
Comment on attachment 8733016 [details] [diff] [review]
Patch

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

r=me, with a question below.

::: xpcom/io/nsScriptableInputStream.cpp
@@ +80,5 @@
>    if (!mInputStream) {
>      return NS_ERROR_NOT_INITIALIZED;
>    }
>  
> +  if (!aResult.SetLength(aCount, fallible) || aResult.Length() != aCount) {

Are you leaving the second check in for safety?  Because it seems to me that:

SetLength fails => second check is also false, but isn't checked
SetLength succeeds => second check must also succeed

and the second check is therefore superfluous.
Attachment #8733016 - Flags: review?(nfroyd) → review+
Yes, I think the second check is redundant too, and merely left it in for safety. I'll remove it.
https://hg.mozilla.org/mozilla-central/rev/a3dd1df42069
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.