Bug 1072801 - Handle OOM when allocating GC statistics slice with an immediate crash; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Mon, 27 Oct 2014 14:54:15 -0700
changeset 212563 111df21a6d66c1732eb210cc8e7ec5e90ebedaa5
parent 212562 3fe837eec0384cb2f72d0873f485e529da99dd77
child 212564 682b11c70169e1b8e363b874d93f3b3dbfeb7a57
push id27721
push usercbook@mozilla.com
push dateTue, 28 Oct 2014 14:55:05 +0000
treeherdermozilla-central@c0ddb1b098ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1072801
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1072801 - Handle OOM when allocating GC statistics slice with an immediate crash; r=sfink
js/src/gc/Statistics.cpp
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -761,17 +761,18 @@ Statistics::beginSlice(const ZoneGCStats
 {
     this->zoneStats = zoneStats;
 
     bool first = runtime->gc.state() == gc::NO_INCREMENTAL;
     if (first)
         beginGC();
 
     SliceData data(reason, PRMJ_Now(), GetPageFaultCount());
-    (void) slices.append(data); /* Ignore any OOMs here. */
+    if (!slices.append(data))
+        CrashAtUnhandlableOOM("Failed to allocate statistics slice.");
 
     if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback)
         (*cb)(JS_TELEMETRY_GC_REASON, reason);
 
     // Slice callbacks should only fire for the outermost level
     if (++gcDepth == 1) {
         bool wasFullGC = zoneStats.isCollectingAllZones();
         if (sliceCallback)