Bug 717658 - OOM crash in BasicLayers: dump sizes to help understand this crash - r=joe
authorBenoit Jacob <jacob.benoit.1@gmail.com>
Tue, 24 Jan 2012 16:12:30 -0500
changeset 86495 bdc686b071bb16499120c8b679f113ea51530c8d
parent 86494 ea41d0de5a04fa4c0a944004f4cc52c9a6c4a91f
child 86496 f9a4b9014002e80aefb0c1e6dc47941db66f965c
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs717658
milestone12.0a1
Bug 717658 - OOM crash in BasicLayers: dump sizes to help understand this crash - r=joe
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"
@@ -2394,17 +2395,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);