Backed out 3 changesets (bug 1524992) for valgrind failures on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Tue, 05 Mar 2019 01:36:59 +0200
changeset 520177 88ffdaa924cd625629d50fdbc97923ee9ee42b0f
parent 520176 f324b0fe247192d8f1a3cad23b84e2e16a56249c
child 520178 ade393862e9dddf6a3acce62453db19e29596688
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1524992
milestone67.0a1
backs outface9d1e886872033b70fbdff5a40eaa244db3fb
ae1e20a595c44100776589dcc1f76418208c88c7
b0b9322c7a5986af47dd41331a1ffd6c196ffc53
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 3 changesets (bug 1524992) for valgrind failures on a CLOSED TREE Backed out changeset face9d1e8868 (bug 1524992) Backed out changeset ae1e20a595c4 (bug 1524992) Backed out changeset b0b9322c7a59 (bug 1524992)
browser/base/content/browser.js
browser/base/content/tabbrowser.js
build/pgo/index.html
build/pgo/profileserver.py
docshell/base/nsAboutRedirector.cpp
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1749,17 +1749,16 @@ var gBrowserInit = {
           gBrowser.loadTabs(uriToLoad, {
             inBackground: false,
             replace: true,
             // See below for the semantics of window.arguments. Only the minimum is supported.
             userContextId: window.arguments[6],
             triggeringPrincipal: window.arguments[8] || Services.scriptSecurityManager.getSystemPrincipal(),
             allowInheritPrincipal: window.arguments[9],
             csp: window.arguments[10],
-            fromExternal: true,
           });
         } catch (e) {}
       } else if (window.arguments.length >= 3) {
         // window.arguments[1]: unused (bug 871161)
         //                 [2]: referrer (nsIURI | string)
         //                 [3]: postData (nsIInputStream)
         //                 [4]: allowThirdPartyFixup (bool)
         //                 [5]: referrerPolicy (int)
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1525,17 +1525,16 @@ window._gBrowser = {
     inBackground,
     newIndex,
     postDatas,
     replace,
     targetTab,
     triggeringPrincipal,
     csp,
     userContextId,
-    fromExternal,
   } = {}) {
     if (!aURIs.length) {
       return;
     }
 
     // The tab selected after this new tab is closed (i.e. the new tab's
     // "owner") is the next adjacent tab (i.e. not the previously viewed tab)
     // when several urls are opened here (i.e. closing the first should select
@@ -1577,19 +1576,16 @@ window._gBrowser = {
       let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
       if (allowThirdPartyFixup) {
         flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
           Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
       }
       if (!allowInheritPrincipal) {
         flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
       }
-      if (fromExternal) {
-        flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
-      }
       try {
         browser.loadURI(aURIs[0], {
           flags,
           postData: postDatas && postDatas[0],
           triggeringPrincipal,
           csp,
         });
       } catch (e) {
@@ -1602,17 +1598,16 @@ window._gBrowser = {
         ownerTab: owner,
         skipAnimation: multiple,
         allowThirdPartyFixup,
         postData: postDatas && postDatas[0],
         userContextId,
         triggeringPrincipal,
         bulkOrderedOpen: multiple,
         csp,
-        fromExternal,
       };
       if (newIndex > -1) {
         params.index = newIndex;
       }
       firstTabAdded = this.addTab(aURIs[0], params);
       if (newIndex > -1) {
         targetTabIndex = firstTabAdded._tPos;
       }
@@ -1624,17 +1619,16 @@ window._gBrowser = {
         allowInheritPrincipal,
         skipAnimation: true,
         allowThirdPartyFixup,
         postData: postDatas && postDatas[i],
         userContextId,
         triggeringPrincipal,
         bulkOrderedOpen: true,
         csp,
-        fromExternal,
       };
       if (targetTabIndex > -1) {
         params.index = ++tabNum;
       }
       this.addTab(aURIs[i], params);
     }
 
     if (firstTabAdded && !inBackground) {
--- a/build/pgo/index.html
+++ b/build/pgo/index.html
@@ -50,20 +50,20 @@
  function loadURL () {
      var interval = defaultInterval;
      if (idx == 0) {
          interval = 90000;
      }
      w.close();
      w = window.open(list[idx++]);
      if (idx < list.length) {
-       window.setTimeout(loadURL, interval);
+     window.setTimeout(loadURL, interval);
      } else {
-       window.postMessage("quit");
+         window.setTimeout(Quitter.quit, interval);
      }
  }
  var i;
  
  for(i=0; i < list.length;i++) {
      document.write(list[i]);
      document.write("<br>");
  }
-</script>
+  </script>
--- a/build/pgo/profileserver.py
+++ b/build/pgo/profileserver.py
@@ -1,119 +1,144 @@
 #!/usr/bin/python
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import json
 import os
+import sys
 
 from buildconfig import substs
 from mozbuild.base import MozbuildObject
 from mozfile import TemporaryDirectory
 from mozhttpd import MozHttpd
-from mozprofile import Preferences
-from mozrunner import CLI
+from mozprofile import FirefoxProfile, Preferences
+from mozprofile.permissions import ServerLocations
+from mozrunner import FirefoxRunner, CLI
 from six import string_types
 
-from marionette_driver.marionette import Marionette
-
 PORT = 8888
 
 PATH_MAPPINGS = {
     '/js-input/webkit/PerformanceTests': 'third_party/webkit/PerformanceTests',
 }
 
+
 if __name__ == '__main__':
     cli = CLI()
     debug_args, interactive = cli.debugger_arguments()
     runner_args = cli.runner_args()
 
     build = MozbuildObject.from_environment()
 
     binary = runner_args.get('binary')
     if not binary:
         binary = build.get_binary_path(where="staged-package")
 
     path_mappings = {
         k: os.path.join(build.topsrcdir, v)
         for k, v in PATH_MAPPINGS.items()
     }
-    httpd = MozHttpd(
-        port=PORT,
-        docroot=os.path.join(build.topsrcdir, "build", "pgo"),
-        path_mappings=path_mappings)
+    httpd = MozHttpd(port=PORT,
+                     docroot=os.path.join(build.topsrcdir, "build", "pgo"),
+                     path_mappings=path_mappings)
     httpd.start(block=False)
 
+    locations = ServerLocations()
+    locations.add_host(host='127.0.0.1',
+                       port=PORT,
+                       options='primary,privileged')
+
     with TemporaryDirectory() as profilePath:
         # TODO: refactor this into mozprofile
         profile_data_dir = os.path.join(build.topsrcdir, 'testing', 'profiles')
         with open(os.path.join(profile_data_dir, 'profiles.json'), 'r') as fh:
             base_profiles = json.load(fh)['profileserver']
 
-        prefpaths = [
-            os.path.join(profile_data_dir, profile, 'user.js')
-            for profile in base_profiles
-        ]
+        prefpaths = [os.path.join(profile_data_dir, profile, 'user.js')
+                     for profile in base_profiles]
 
         prefs = {}
         for path in prefpaths:
             prefs.update(Preferences.read_prefs(path))
 
-        interpolation = {
-            "server": "%s:%d" % httpd.httpd.server_address,
-            "OOP": "false"
-        }
+        interpolation = {"server": "%s:%d" % httpd.httpd.server_address,
+                         "OOP": "false"}
         for k, v in prefs.items():
             if isinstance(v, string_types):
                 v = v.format(**interpolation)
             prefs[k] = Preferences.cast(v)
 
-        env = os.environ
-        env["XPCOM_DEBUG_BREAK"] = "1"
+        profile = FirefoxProfile(profile=profilePath,
+                                 preferences=prefs,
+                                 addons=[os.path.join(
+                                     build.topsrcdir, 'tools', 'quitter',
+                                     'quitter@mozilla.org.xpi')],
+                                 locations=locations)
+
+        env = os.environ.copy()
+        env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
+        env["XPCOM_DEBUG_BREAK"] = "warn"
 
         # For VC12+, make sure we can find the right bitness of pgort1x0.dll
         if not substs.get('HAVE_64BIT_BUILD'):
             for e in ('VS140COMNTOOLS', 'VS120COMNTOOLS'):
                 if e not in env:
                     continue
 
                 vcdir = os.path.abspath(os.path.join(env[e], '../../VC/bin'))
                 if os.path.exists(vcdir):
                     env['PATH'] = '%s;%s' % (vcdir, env['PATH'])
                     break
 
         # Add MOZ_OBJDIR to the env so that cygprofile.cpp can use it.
         env["MOZ_OBJDIR"] = build.topobjdir
 
-        jarlog = env.get("JARLOG_FILE")
-        if jarlog:
-            abs_jarlog = os.path.abspath(jarlog)
-            env["MOZ_JAR_LOG_FILE"] = abs_jarlog
-            print("jarlog: %s" % abs_jarlog)
-
         # Write to an output file if we're running in automation
-        process_args = []
-        logfile = None
+        process_args = {}
         if 'UPLOAD_PATH' in env:
-            logfile = os.path.join(env['UPLOAD_PATH'], 'profile-run.log')
+            process_args['logfile'] = os.path.join(env['UPLOAD_PATH'], 'profile-run-1.log')
 
         # Run Firefox a first time to initialize its profile
-        driver = Marionette(bin=binary, prefs=prefs, gecko_log=logfile)
-        driver.start_session()
-        driver.restart(in_app=True)
+        runner = FirefoxRunner(profile=profile,
+                               binary=binary,
+                               cmdargs=['data:text/html,<script>Quitter.quit()</script>'],
+                               env=env,
+                               process_args=process_args)
+        runner.start()
+        ret = runner.wait()
+        if ret:
+            print("Firefox exited with code %d during profile initialization"
+                  % ret)
+            logfile = process_args.get('logfile')
+            if logfile:
+                print("Firefox output (%s):" % logfile)
+                with open(logfile) as f:
+                    print(f.read())
+            httpd.stop()
+            sys.exit(ret)
 
-        # Now generate the profile and wait for it to complete
-        driver.navigate("http://localhost:%d/index.html" % PORT)
-        driver.execute_async_script(
-            '''
-            const [resolve] = arguments;
-            window.addEventListener('message', event => {
-                if (event.data === 'quit') {
-                    resolve();
-                }
-            });
-            ''',
-            script_timeout=999999999)
+        jarlog = os.getenv("JARLOG_FILE")
+        if jarlog:
+            env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
+            print("jarlog: %s" % env["MOZ_JAR_LOG_FILE"])
 
-        driver.quit(in_app=True)
+        if 'UPLOAD_PATH' in env:
+            process_args['logfile'] = os.path.join(env['UPLOAD_PATH'], 'profile-run-2.log')
+        cmdargs = ["http://localhost:%d/index.html" % PORT]
+        runner = FirefoxRunner(profile=profile,
+                               binary=binary,
+                               cmdargs=cmdargs,
+                               env=env,
+                               process_args=process_args)
+        runner.start(debug_args=debug_args, interactive=interactive)
+        ret = runner.wait()
         httpd.stop()
+        if ret:
+            print("Firefox exited with code %d during profiling" % ret)
+            logfile = process_args.get('logfile')
+            if logfile:
+                print("Firefox output (%s):" % logfile)
+                with open(logfile) as f:
+                    print(f.read())
+            sys.exit(ret)
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -142,22 +142,16 @@ nsAboutRedirector::NewChannel(nsIURI* aU
   nsAutoCString path;
   nsresult rv = NS_GetAboutModuleName(aURI, path);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (path.EqualsASCII("crashparent") || path.EqualsASCII("crashcontent")) {
-    bool isExternal;
-    aLoadInfo->GetLoadTriggeredFromExternal(&isExternal);
-    if (isExternal) {
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-
     nsCOMPtr<nsIChannel> channel = new CrashChannel(aURI);
     channel->SetLoadInfo(aLoadInfo);
     channel.forget(aResult);
     return NS_OK;
   }
 
 #ifdef ABOUT_CONFIG_BLOCKED_GV
   // We don't want to allow access to about:config from