Bug 717658 - OOM crash in BasicLayers: dump sizes to help understand this crash - r=joe, a=akeybl
authorBenoit Jacob <jacob.benoit.1@gmail.com>
Tue, 24 Jan 2012 16:12:30 -0500
changeset 85138 b5ed79ddf35093a96816ffe424b05b547b1783f5
parent 85137 cae62722a5e741e9662fc6eca9deddc2bb6a846d
child 85139 4a961cfc4408e36846fa1290e680c5fb9ec89f73
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, akeybl
bugs717658
milestone11.0a2
Bug 717658 - OOM crash in BasicLayers: dump sizes to help understand this crash - r=joe, a=akeybl
gfx/layers/basic/BasicLayers.cpp
--- a/gfx/layers/basic/BasicLayers.cpp
+++ b/gfx/layers/basic/BasicLayers.cpp
@@ -45,16 +45,17 @@
 #include "mozilla/layers/PLayersParent.h"
 #include "mozilla/gfx/2D.h"
 
 #include "ipc/ShadowLayerChild.h"
 
 #include "BasicLayers.h"
 #include "ImageLayers.h"
 
+#include "prprf.h"
 #include "nsTArray.h"
 #include "nsGUIEvent.h"
 #include "gfxContext.h"
 #include "gfxImageSurface.h"
 #include "gfxPattern.h"
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "ThebesLayerBuffer.h"
@@ -2380,17 +2381,22 @@ BasicShadowableThebesLayer::CreateBuffer
                                           mBackBuffer);
     mBackBuffer = SurfaceDescriptor();
   }
 
   // XXX error handling
   if (!BasicManager()->AllocBuffer(gfxIntSize(aSize.width, aSize.height),
                                    aType,
                                    &mBackBuffer)) {
-      NS_RUNTIMEABORT("creating ThebesLayer 'back buffer' failed!");
+      enum { buflen = 256 };
+      char buf[buflen];
+      PR_snprintf(buf, buflen,
+                  "creating ThebesLayer 'back buffer' failed! width=%d, height=%d, type=%x",
+                  aSize.width, aSize.height, int(aType));
+      NS_RUNTIMEABORT(buf);
   }
 
   NS_ABORT_IF_FALSE(!mIsNewBuffer,
                     "Bad! Did we create a buffer twice without painting?");
 
   mIsNewBuffer = true;
 
   return BasicManager()->OpenDescriptor(mBackBuffer);