Closed Bug 1122361 Opened 11 years ago Closed 11 years ago

"Assertion failure: reportp" (js_ReportUncaughtException) with OOM

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: jruderman, Assigned: bzbarsky)

References

Details

(Keywords: assertion, regression, testcase, Whiteboard: [fuzzblocker])

Attachments

(2 files, 1 obsolete file)

Attached file stack
oomAfterAllocations(0); ({}); Assertion failure: reportp, at /Users/jruderman/trees/mozilla-central/js/src/jscntxt.cpp:868 The first bad revision is: changeset: https://hg.mozilla.org/mozilla-central/rev/a2f5fa870c8a user: Boris Zbarsky date: Fri Jul 04 01:24:54 2014 -0400 summary: Bug 966452 part 1. Refactor the js_ReportUncaughtException to produce a (message, JSErrorReport*) pair before reporting. r=waldo and including the fix for bug 1034616 to fix JS tests to deal with this, r=jorendorff. r=terrence on the AutoStableStringChars bits
I bet we landed in populateUncaughtExceptionReportVA, js_ExpandErrorArguments returned false, so we never set reportp but also didn't return false from ErrorReport::init.
Attachment #8550099 - Flags: review?(jwalden+bmo)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
This blocks all further OOM testing right now, as it's a very frequently triggering bug.
Whiteboard: [fuzzblocker]
Comment on attachment 8550099 [details] [diff] [review] Deal with populateUncaughtExceptionReport failing Review of attachment 8550099 [details] [diff] [review]: ----------------------------------------------------------------- I assume a patch here will need backporting eventually, right? Feel free to consider this an r+ on this patch for backporting purposes, but on trunk we have to do better. ::: js/src/jsexn.cpp @@ +857,5 @@ > populateUncaughtExceptionReport(cx, message_); > + if (!reportp) { > + // Just give up. We're out of memory or something, not > + // much we can do here. > + return false; So this seems fine enough. But. This is totally unreadable with reportp not actually being the local variable I expected it was on initial read of the code. Please convert populateUncaughtExceptionReport to return a bool indicating success/failure the normal way. That makes clear that there's a failure that's possibly been rectified, justifying the double-check of what is (at this level of code-reading) apparently a local variable. Also remove it and the VA form from jsfriendapi.h (noticed just now via MXR) while you're in the area. Those must be detritus from something, because they appear unused now.
Attachment #8550099 - Flags: review?(jwalden+bmo) → review-
> Also remove it and the VA form from jsfriendapi.h These are private member methods of the ErrorReport class, and while these methods are not used from outside the JS engine (being private and all), the class itself is used. Did you want me to make them static methods or something? But they assign to the class-member reportp....
(In reply to Boris Zbarsky [:bz] from comment #5) > These are private member methods of the ErrorReport class, and while these > methods are not used from outside the JS engine (being private and all), the > class itself is used. Oh, sigh. Never mind, MXR search results weren't showing the leading whitespace on the line that would have reminded me this was a class method, and that the class itself would of course still be used externally.
Updated to review comments. I don't think we need to worry about backporting this, but if we do this should backport fine, I expect.
Attachment #8552819 - Flags: review?(jwalden+bmo)
Attachment #8550099 - Attachment is obsolete: true
Attachment #8552819 - Flags: review?(jwalden+bmo) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: