Bug 997908 - Test patch to make crash stacks better. r=mccr8
☠☠ backed out by 7e06f31a3f01 ☠ ☠
authorSteven Michaud <smichaud@pobox.com>
Fri, 19 Sep 2014 11:59:40 -0500
changeset 206272 317c684efd2d1646aca61f3d41a449a4f937db37
parent 206271 6dc8272079e625ad360c2aa9bc30823fecdbbde8
child 206273 d180f7e3f608a1ffb000e4922bd73cdbfcf42f6d
push id27520
push userkwierso@gmail.com
push dateSat, 20 Sep 2014 00:25:19 +0000
treeherdermozilla-central@27253887d2cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs997908
milestone35.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 997908 - Test patch to make crash stacks better. r=mccr8
xpcom/base/CycleCollectedJSRuntime.cpp
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -1049,16 +1049,22 @@ CycleCollectedJSRuntime::DeferredFinaliz
   if (!hadThingArray) {
     mDeferredFinalizerTable.Put(aFunc, thingArray);
   }
 }
 
 void
 CycleCollectedJSRuntime::DeferredFinalize(nsISupports* aSupports)
 {
+  // We'll crash here if aSupports is invalid, which is better (more
+  // informative) than crashing in ReleaseSliceNow().  See bug 997908.
+  // This patch should be backed out when bug 997908 gets fixed, or if
+  // it doesn't actually help fix that bug.
+  NS_IF_ADDREF(aSupports);
+  NS_IF_RELEASE(aSupports);
   mDeferredSupports.AppendElement(aSupports);
 }
 
 void
 CycleCollectedJSRuntime::DumpJSHeap(FILE* aFile)
 {
   js::DumpHeapComplete(Runtime(), aFile, js::CollectNurseryBeforeDump);
 }