Backed out 4 changesets (bug 1521191) for causing leaks on multiple tests
authorDorel Luca <dluca@mozilla.com>
Sat, 26 Jan 2019 03:23:40 +0200
changeset 515533 044a86a4032cf1ab76e4cd43f5d7929fcff0c9a0
parent 515532 ad292914ca7eb4d20e9315dc50b1b79a1493a994
child 515534 34e24b0fb7b7296e7a4b928dd217b15d2f0d96ac
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1521191
milestone66.0a1
backs out138e162d2778d37a1b3cc474aade64647bbc1bd6
3782d011cc9f7d2b146c634d9bb07337c1494b2d
38d3da4804d7a15fe363ab159045ab361b21beee
d6ce4b187195a3e5a763c810578e928b628847aa
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
Backed out 4 changesets (bug 1521191) for causing leaks on multiple tests Backed out changeset 138e162d2778 (bug 1521191) Backed out changeset 3782d011cc9f (bug 1521191) Backed out changeset 38d3da4804d7 (bug 1521191) Backed out changeset d6ce4b187195 (bug 1521191)
js/xpconnect/idl/xpccomponents.idl
js/xpconnect/src/XPCComponents.cpp
testing/mochitest/tests/python/files/test_negative_leaks.html
testing/mochitest/tests/python/files/test_no_leak_log.html
testing/mochitest/tests/python/test_basic_mochitest_plain.py
testing/mozbase/mozlog/mozlog/handlers/statushandler.py
xpcom/base/nsTraceRefcnt.cpp
xpcom/base/nsTraceRefcnt.h
--- a/js/xpconnect/idl/xpccomponents.idl
+++ b/js/xpconnect/idl/xpccomponents.idl
@@ -324,28 +324,16 @@ interface nsIXPCComponents_Utils : nsISu
     void unlinkGhostWindows();
 
     /*
      * In an NS_FREE_PERMANENT_DATA build, intentionally leak a C++ object. This
      * is needed to test leak checking.
      */
     void intentionallyLeak();
 
-    /*
-     * In a debug build, cause the XPCOM leak checker to report a negative leak.
-     * This is needed to test leak checking.
-     */
-    void intentionallyLeakNegatively();
-
-    /*
-     * In a debug build, make XPCOM not print out a bloat log in this process.
-     * This is needed to test leak checking.
-     */
-    void disableDumpStatistics();
-
     [implicit_jscontext]
     jsval getJSTestingFunctions();
 
     /*
      * To be called from JS only.
      *
      * Call 'function', using the provided stack as the async stack responsible
      * for the call, and propagate its return value or the exception it throws.
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -41,17 +41,16 @@
 #include "nsPIDOMWindow.h"
 #include "nsGlobalWindow.h"
 #include "nsScriptError.h"
 #include "GeckoProfiler.h"
 #include "mozilla/EditorSpellCheck.h"
 #include "nsCommandLine.h"
 #include "nsCommandParams.h"
 #include "nsPersistentProperties.h"
-#include "nsTraceRefcnt.h"
 #include "nsIDocumentEncoder.h"
 
 using namespace mozilla;
 using namespace JS;
 using namespace js;
 using namespace xpc;
 using mozilla::dom::Exception;
 
@@ -1754,36 +1753,16 @@ nsXPCComponents_Utils::IntentionallyLeak
   Unused << new IntentionallyLeakedObject();
   return NS_OK;
 #else
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif
 }
 
 NS_IMETHODIMP
-nsXPCComponents_Utils::IntentionallyLeakNegatively() {
-#ifdef DEBUG
-  MOZ_COUNT_DTOR(IntentionallyLeakedObject);
-  return NS_OK;
-#else
-  return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-NS_IMETHODIMP
-nsXPCComponents_Utils::DisableDumpStatistics() {
-#ifdef DEBUG
-  nsTraceRefcnt::DisableDumpStatistics();
-  return NS_OK;
-#else
-  return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-NS_IMETHODIMP
 nsXPCComponents_Utils::GetJSTestingFunctions(JSContext* cx,
                                              MutableHandleValue retval) {
   JSObject* obj = js::GetTestingFunctions(cx);
   if (!obj) {
     return NS_ERROR_XPC_JAVASCRIPT_ERROR;
   }
   retval.setObject(*obj);
   return NS_OK;
deleted file mode 100644
--- a/testing/mochitest/tests/python/files/test_negative_leaks.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1343659
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test Pass</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-    SpecialPowers.Cu.intentionallyLeakNegatively();
-    ok(true, "Test is ok");
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343659">Mozilla Bug 1343659</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/testing/mochitest/tests/python/files/test_no_leak_log.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1343659
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test Crash</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-    SpecialPowers.Cu.disableDumpStatistics();
-    ok(true, "Test is ok");
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343659">Mozilla Bug 1343659</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
--- a/testing/mochitest/tests/python/test_basic_mochitest_plain.py
+++ b/testing/mochitest/tests/python/test_basic_mochitest_plain.py
@@ -122,30 +122,10 @@ def test_output_leak(runtests):
         found_leaks = True
         assert lt['process'] == "tab"
         assert lt['bytes'] == 1
         assert lt['objects'] == ['IntentionallyLeakedObject']
 
     assert found_leaks, "At least one process should have leaked"
 
 
-@pytest.mark.skip_mozinfo("!debug")
-def test_output_no_leak_log(runtests):
-    status, lines = runtests('test_no_leak_log.html')
-    assert status == 0
-
-    tbpl_status, log_level, summary = get_mozharness_status(lines, status)
-    assert tbpl_status == TBPL_WARNING
-    assert log_level == WARNING
-
-
-@pytest.mark.skip_mozinfo("!debug")
-def test_output_negative_leaks(runtests):
-    status, lines = runtests('test_negative_leaks.html')
-    assert status == 0
-
-    tbpl_status, log_level, summary = get_mozharness_status(lines, status)
-    assert tbpl_status == TBPL_FAILURE
-    assert log_level == ERROR
-
-
 if __name__ == '__main__':
     mozunit.main()
--- a/testing/mozbase/mozlog/mozlog/handlers/statushandler.py
+++ b/testing/mozbase/mozlog/mozlog/handlers/statushandler.py
@@ -63,22 +63,17 @@ class StatusHandler(object):
             if not data.get("allowed_match"):
                 self.unexpected_statuses["FAIL"] += 1
 
         if action == "lsan_summary":
             if not data.get("allowed", False):
                 self.unexpected_statuses["FAIL"] += 1
 
         if action == "mozleak_total":
-            data_bytes = data["bytes"]
-            if data_bytes is None:
-                if not (data.get("induced_crash", False) or
-                        data.get("ignore_missing", False)):
-                    self.unexpected_statuses["FAIL"] += 1
-            elif data_bytes > data.get("threshold", 0):
+            if data.get("bytes", 0) > data.get("threshold", 0):
                 self.unexpected_statuses["FAIL"] += 1
 
     def summarize(self):
         return RunSummary(
             dict(self.unexpected_statuses),
             dict(self.expected_statuses),
             dict(self.log_level_counts),
             dict(self.action_counts),
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -112,17 +112,16 @@ static bool gLogLeaksOnly;
 // if gActivityTLS == BAD_TLS_INDEX, then we're
 // unitialized... otherwise this points to a NSPR TLS thread index
 // indicating whether addref activity is legal. If the PTR_TO_INT32 is 0 then
 // activity is ok, otherwise not!
 static unsigned gActivityTLS = BAD_TLS_INDEX;
 
 static bool gInitialized;
 static nsrefcnt gInitCount;
-static bool gDisableDumpStatistics = false;
 
 static FILE* gBloatLog = nullptr;
 static FILE* gRefcntsLog = nullptr;
 static FILE* gAllocLog = nullptr;
 static FILE* gCOMPtrLog = nullptr;
 
 static void WalkTheStackSavingLocations(std::vector<void*>& aLocations);
 
@@ -395,20 +394,16 @@ nsresult nsTraceRefcnt::DumpStatistics()
 
   AutoTraceLogLock lock;
 
   MOZ_ASSERT(!gDumpedStatistics,
              "Calling DumpStatistics more than once may result in "
              "bogus positive or negative leaks being reported");
   gDumpedStatistics = true;
 
-  if (gDisableDumpStatistics) {
-    return NS_OK;
-  }
-
   // Don't try to log while we hold the lock, we'd deadlock.
   AutoRestore<LoggingType> saveLogging(gLogging);
   gLogging = NoLogging;
 
   BloatEntry total("TOTAL", 0);
   for (auto iter = gBloatView->Iter(); !iter.Done(); iter.Next()) {
     BloatEntry* entry = iter.Data();
     if (nsCRT::strcmp(entry->GetClassName(), "TOTAL") != 0) {
@@ -1163,10 +1158,8 @@ void nsTraceRefcnt::Shutdown() {
 
 void nsTraceRefcnt::SetActivityIsLegal(bool aLegal) {
   if (gActivityTLS == BAD_TLS_INDEX) {
     PR_NewThreadPrivateIndex(&gActivityTLS, nullptr);
   }
 
   PR_SetThreadPrivate(gActivityTLS, reinterpret_cast<void*>(!aLegal));
 }
-
-void nsTraceRefcnt::DisableDumpStatistics() { gDisableDumpStatistics = true; }
--- a/xpcom/base/nsTraceRefcnt.h
+++ b/xpcom/base/nsTraceRefcnt.h
@@ -20,17 +20,11 @@ class nsTraceRefcnt {
   static void WalkTheStack(FILE* aStream);
 
   /**
    * Tell nsTraceRefcnt whether refcounting, allocation, and destruction
    * activity is legal.  This is used to trigger assertions for any such
    * activity that occurs because of static constructors or destructors.
    */
   static void SetActivityIsLegal(bool aLegal);
-
-  /**
-   * Disable bloat log output at shutdown. This is used to test that the
-   * test harness handles a missing log properly.
-   */
-  static void DisableDumpStatistics();
 };
 
 #endif  // nsTraceRefcnt_h