Bug 1587463 - Remove LSan/UBSan suppressions option from automation. r=ahal
authorChristian Holler <choller@mozilla.com>
Wed, 16 Oct 2019 16:11:23 +0000
changeset 497876 71ff8b5daaf686cbd578d260e4a1683c1ccab7ae
parent 497875 2fbdd8a2052908e824687e3d85d620d506122418
child 497877 448734fab30e8dc1fcc2734c76d6a0339f6de26a
push id36700
push usershindli@mozilla.com
push dateThu, 17 Oct 2019 03:46:32 +0000
treeherdermozilla-central@9e3ef2b6a889 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1587463
milestone71.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 1587463 - Remove LSan/UBSan suppressions option from automation. r=ahal Depends on D48786 Differential Revision: https://phabricator.services.mozilla.com/D48787
build/sanitizers/lsan_suppressions.txt
build/sanitizers/tsan_suppressions.txt
build/sanitizers/ubsan_suppressions.txt
testing/mochitest/moz.build
testing/mochitest/runtests.py
testing/mozbase/mozrunner/mozrunner/utils.py
testing/web-platform/moz.build
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
deleted file mode 100644
--- a/build/sanitizers/lsan_suppressions.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-### !!! Please do not add suppressions for new leaks in Gecko code, unless they are intentional !!!
-
-###
-### Some of these leak in every test run.
-###
-
-# LSan runs with a shallow stack depth and no debug symbols, so some small intentional
-# leaks in system libraries show up with this.  You do not want this enabled
-# when running locally with a deep stack, as it can catch too much.
-leak:libc.so
-
-# nsComponentManagerImpl intentionally leaks factory entries, and probably some other stuff.
-leak:nsComponentManagerImpl
-# These two variants are needed when fast unwind is disabled and stack depth is limited.
-leak:mozJSComponentLoader::LoadModule
-leak:nsNativeModuleLoader::LoadModule
-
-# Bug 981220 - Pixman fails to free TLS memory.
-leak:pixman_implementation_lookup_composite
-
-# Bug 987918 - Font shutdown leaks when CLEANUP_MEMORY is not enabled.
-leak:libfontconfig.so
-leak:GI___strdup
-# The symbol is really __GI___strdup, but if you have the leading _, it doesn't suppress it.
-
-# Bug 1078015 - If the process terminates during a PR_Sleep, LSAN  detects a leak
-leak:PR_Sleep
-
-# Bug 1363976 - Stylo holds some global data alive forever.
-leak:style::global_style_data
-
-###
-### Many leaks only affect some test suites.  The suite annotations are not checked.
-###
-
-# Bug 979928 - WebRTC leaks in different mochitest suites.
-leak:NR_reg_init
-# nr_reg_local_init should be redundant with NR_reg_init, but on Aurora
-# we get fewer stack frames for some reason.
-leak:nr_reg_local_init
-leak:r_log_register
-leak:nr_reg_set
-
-# This is a one-time leak in mochitest-bc, so it is probably okay to ignore.
-leak:GlobalPrinters::InitializeGlobalPrinters
-leak:nsPSPrinterList::GetPrinterList
-
-# Bug 1028456 - Various NSPR fd-related leaks in different mochitest suites.
-leak:_PR_Getfd
-
-# Bug 1028483 - The XML parser sometimes leaks an object. Mostly happens in toolkit/components/thumbnails.
-leak:processInternalEntity
-
-# Bug 1187421 - NSS does not always free the error stack in different mochitest suites.
-leak:nss_ClearErrorStack
-
-###
-### Leaks with system libraries in their stacks. These show up across a number of tests.
-### Better symbols and disabling fast stackwalking may help diagnose these.
-###
-
-leak:libcairo.so
-leak:libdl.so
-leak:libdricore.so
-leak:libdricore9.2.1.so
-leak:libGL.so
-leak:libglib-2.0.so
-leak:libglsl.so
-leak:libp11-kit.so
-leak:libpixman-1.so
-leak:libpulse.so
-# lubpulsecommon 1.1 is Ubuntu 12.04
-leak:libpulsecommon-1.1.so
-# lubpulsecommon 1.1 is Ubuntu 16.04
-leak:libpulsecommon-8.0.so
-leak:libresolv.so
-leak:libstdc++.so
-leak:libXrandr.so
-leak:pthread_setspecific_internal
-leak:swrast_dri.so
deleted file mode 100644
--- a/build/sanitizers/tsan_suppressions.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Bug 931149
-race:DoImageDataComplete
-
-# Bug 939786
-race:_pt_root
-
-# Bug 939788
-# Tracked by http://code.google.com/p/thread-sanitizer/issues/detail?id=40
-race:ELMCreationDetector
-
-# Bug 939790
-race:xpcom/components/nsComponentManager.h
-
-# Bug 939807
-race:ComputeUTCTime
-
-# Bug 939805
-race:g_variant_type_info_get
-
-# Bug 844759
-race:js::gc::ArenaLists::allocateFromArenaInline
deleted file mode 100644
--- a/build/sanitizers/ubsan_suppressions.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# This list contains runtime suppression entries for any issues reported
-# by UndefinedBehaviorSanitizer (UBSan). Unlike the compile-time blacklists,
-# this list allows us to blacklist source code files and functions only for
-# specific checks performed by UBSan.
-#
-# Example:
-#
-# signed-integer-overflow:file-with-known-overflow.cpp
-# alignment:function_doing_unaligned_access
-# vptr:shared_object_with_vptr_failures.so
-#
-# Since runtime suppressions are much more expensive than compile-time
-# blacklisting, this list should not be used for frequent issues but rather
-# only for sporadic warnings that have already been checked and confirmed
-# to not be bugs.
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -80,18 +80,16 @@ MOCHITEST_CHROME_MANIFESTS += [
 
 BROWSER_CHROME_MANIFESTS += [
     'baselinecoverage/browser_chrome/browser.ini'
 ]
 
 TEST_HARNESS_FILES.testing.mochitest += [
     '/build/mobile/remoteautomation.py',
     '/build/pgo/server-locations.txt',
-    '/build/sanitizers/lsan_suppressions.txt',
-    '/build/sanitizers/ubsan_suppressions.txt',
     '/build/valgrind/cross-architecture.sup',
     '/build/valgrind/i386-pc-linux-gnu.sup',
     '/build/valgrind/x86_64-pc-linux-gnu.sup',
     '/netwerk/test/httpserver/httpd.js',
     'bisection.py',
     'browser-harness.xul',
     'browser-test.js',
     'chrome-harness.js',
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1623,31 +1623,25 @@ toolbar#nav-bar {
         content = json.dumps(d)
 
         with open(os.path.join(options.profilePath, "testConfig.js"), "w") as config:
             config.write(content)
 
     def buildBrowserEnv(self, options, debugger=False, env=None):
         """build the environment variables for the specific test and operating system"""
         if mozinfo.info["asan"] and mozinfo.isLinux and mozinfo.bits == 64:
-            lsanPath = SCRIPT_DIR
+            useLSan = True
         else:
-            lsanPath = None
-
-        if mozinfo.info["ubsan"]:
-            ubsanPath = SCRIPT_DIR
-        else:
-            ubsanPath = None
+            useLSan = False
 
         browserEnv = self.environment(
             xrePath=options.xrePath,
             env=env,
             debugger=debugger,
-            lsanPath=lsanPath,
-            ubsanPath=ubsanPath)
+            useLSan=useLSan)
 
         if hasattr(options, "topsrcdir"):
             browserEnv["MOZ_DEVELOPER_REPO_DIR"] = options.topsrcdir
         if hasattr(options, "topobjdir"):
             browserEnv["MOZ_DEVELOPER_OBJ_DIR"] = options.topobjdir
 
         if options.headless:
             browserEnv["MOZ_HEADLESS"] = '1'
--- a/testing/mozbase/mozrunner/mozrunner/utils.py
+++ b/testing/mozbase/mozrunner/mozrunner/utils.py
@@ -80,17 +80,17 @@ def _find_marionette_in_args(*args, **kw
 
 
 def _raw_log():
     import logging
     return logging.getLogger(__name__)
 
 
 def test_environment(xrePath, env=None, crashreporter=True, debugger=False,
-                     lsanPath=None, ubsanPath=None, log=None):
+                     useLSan=False, log=None):
     """
     populate OS environment variables for mochitest and reftests.
 
     Originally comes from automationutils.py. Don't use that for new code.
     """
 
     env = os.environ.copy() if env is None else env
     log = log or _raw_log()
@@ -177,30 +177,22 @@ def test_environment(xrePath, env=None, 
             asanOptions = []
             if totalMemory <= 1024 * 1024 * 4:
                 message = message % 'low-memory'
                 asanOptions = [
                     'quarantine_size=50331648', 'malloc_context_size=5']
             else:
                 message = message % 'default memory'
 
-            if lsanPath:
+            if useLSan:
                 log.info("LSan enabled.")
                 asanOptions.append('detect_leaks=1')
                 lsanOptions = ["exitcode=0"]
                 # Uncomment out the next line to report the addresses of leaked objects.
                 # lsanOptions.append("report_objects=1")
-                suppressionsFile = os.path.join(
-                    lsanPath, 'lsan_suppressions.txt')
-                if os.path.exists(suppressionsFile):
-                    log.info("LSan using suppression file " + suppressionsFile)
-                    lsanOptions.append("suppressions=" + suppressionsFile)
-                else:
-                    log.info("WARNING | runtests.py | LSan suppressions file"
-                             " does not exist! " + suppressionsFile)
                 env["LSAN_OPTIONS"] = ':'.join(lsanOptions)
 
             if len(asanOptions):
                 env['ASAN_OPTIONS'] = ':'.join(asanOptions)
 
         except OSError as err:
             log.info("Failed determine available memory, disabling ASan"
                      " low-memory configuration: %s" % err.strerror)
@@ -219,28 +211,17 @@ def test_environment(xrePath, env=None, 
             log.info("INFO | runtests.py | TSan using symbolizer at %s"
                      % llvmsym)
         else:
             log.error("TEST-UNEXPECTED-FAIL | runtests.py | Failed to find TSan"
                       " symbolizer at %s" % llvmsym)
 
     ubsan = bool(mozinfo.info.get("ubsan"))
     if ubsan and (mozinfo.isLinux or mozinfo.isMac):
-        if ubsanPath:
-            log.info("UBSan enabled.")
-            ubsanOptions = []
-            suppressionsFile = os.path.join(
-                ubsanPath, 'ubsan_suppressions.txt')
-            if os.path.exists(suppressionsFile):
-                log.info("UBSan using suppression file " + suppressionsFile)
-                ubsanOptions.append("suppressions=" + suppressionsFile)
-            else:
-                log.info("WARNING | runtests.py | UBSan suppressions file"
-                         " does not exist! " + suppressionsFile)
-            env["UBSAN_OPTIONS"] = ':'.join(ubsanOptions)
+        log.info("UBSan enabled.")
 
     return env
 
 
 def get_stack_fixer_function(utilityPath, symbolsPath):
     """
     Return a stack fixing function, if possible, to use on output lines.
 
--- a/testing/web-platform/moz.build
+++ b/testing/web-platform/moz.build
@@ -7,20 +7,16 @@
 TEST_HARNESS_FILES['web-platform'] += [
     'mach_commands_base.py',
     'mach_test_package_commands.py',
     'outbound/**',
     'runtests.py',
     'wptrunner.ini',
 ]
 
-TEST_HARNESS_FILES['web-platform'].prefs += [
-    '/build/sanitizers/lsan_suppressions.txt',
-]
-
 PYTHON_UNITTEST_MANIFESTS += ['python.ini']
 
 with Files("**"):
     SCHEDULES.exclusive = [
         'web-platform-tests',
         'web-platform-tests-reftests',
         'web-platform-tests-wdspec',
     ]
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -75,17 +75,16 @@ def browser_kwargs(test_type, run_info_d
             "test_type": test_type,
             "debug_info": kwargs["debug_info"],
             "symbols_path": kwargs["symbols_path"],
             "stackwalk_binary": kwargs["stackwalk_binary"],
             "certutil_binary": kwargs["certutil_binary"],
             "ca_certificate_path": config.ssl_config["ca_cert_path"],
             "e10s": kwargs["gecko_e10s"],
             "enable_webrender": kwargs["enable_webrender"],
-            "lsan_dir": kwargs["lsan_dir"],
             "stackfix_dir": kwargs["stackfix_dir"],
             "binary_args": kwargs["binary_args"],
             "timeout_multiplier": get_timeout_multiplier(test_type,
                                                          run_info_data,
                                                          **kwargs),
             "leak_check": run_info_data["debug"] and (kwargs["leak_check"] is not False),
             "asan": run_info_data.get("asan"),
             "stylo_threads": kwargs["stylo_threads"],
@@ -203,17 +202,17 @@ def update_properties():
 
 
 class FirefoxBrowser(Browser):
     init_timeout = 70
     shutdown_timeout = 70
 
     def __init__(self, logger, binary, prefs_root, test_type, extra_prefs=None, debug_info=None,
                  symbols_path=None, stackwalk_binary=None, certutil_binary=None,
-                 ca_certificate_path=None, e10s=False, enable_webrender=False, lsan_dir=None, stackfix_dir=None,
+                 ca_certificate_path=None, e10s=False, enable_webrender=False, stackfix_dir=None,
                  binary_args=None, timeout_multiplier=None, leak_check=False, asan=False,
                  stylo_threads=1, chaos_mode_flags=None, config=None, browser_channel="nightly", headless=None, **kwargs):
         Browser.__init__(self, logger)
         self.binary = binary
         self.prefs_root = prefs_root
         self.test_type = test_type
         self.extra_prefs = extra_prefs
         self.marionette_port = None
@@ -233,17 +232,16 @@ class FirefoxBrowser(Browser):
                                                         self.symbols_path)
         else:
             self.stack_fixer = None
 
         if timeout_multiplier:
             self.init_timeout = self.init_timeout * timeout_multiplier
 
         self.asan = asan
-        self.lsan_dir = lsan_dir
         self.lsan_allowed = None
         self.lsan_max_stack_depth = None
         self.mozleak_allowed = None
         self.mozleak_thresholds = None
         self.leak_check = leak_check
         self.leak_report_file = None
         self.lsan_handler = None
         self.stylo_threads = stylo_threads
@@ -274,18 +272,17 @@ class FirefoxBrowser(Browser):
         if self.asan:
             self.lsan_handler = mozleak.LSANLeaks(self.logger,
                                                   scope=group_metadata.get("scope", "/"),
                                                   allowed=self.lsan_allowed,
                                                   maxNumRecordedFrames=self.lsan_max_stack_depth)
 
         env = test_environment(xrePath=os.path.dirname(self.binary),
                                debugger=self.debug_info is not None,
-                               log=self.logger,
-                               lsanPath=self.lsan_dir)
+                               useLSan=True, log=self.logger)
 
         env["STYLO_THREADS"] = str(self.stylo_threads)
         if self.chaos_mode_flags is not None:
             env["MOZ_CHAOSMODE"] = str(self.chaos_mode_flags)
         if self.headless:
             env["MOZ_HEADLESS"] = "1"
         if self.enable_webrender:
             env["MOZ_WEBRENDER"] = "1"
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -257,18 +257,16 @@ scheme host and port.""")
     gecko_group.add_argument("--disable-e10s", dest="gecko_e10s", action="store_false", default=True,
                              help="Run tests without electrolysis preferences")
     gecko_group.add_argument("--enable-webrender", dest="enable_webrender", action="store_true", default=None,
                              help="Enable the WebRender compositor in Gecko (defaults to disabled).")
     gecko_group.add_argument("--no-enable-webrender", dest="enable_webrender", action="store_false",
                              help="Disable the WebRender compositor in Gecko.")
     gecko_group.add_argument("--stackfix-dir", dest="stackfix_dir", action="store",
                              help="Path to directory containing assertion stack fixing scripts")
-    gecko_group.add_argument("--lsan-dir", dest="lsan_dir", action="store",
-                             help="Path to directory containing LSAN suppressions file")
     gecko_group.add_argument("--setpref", dest="extra_prefs", action='append',
                              default=[], metavar="PREF=VALUE",
                              help="Defines an extra user preference (overrides those in prefs_root)")
     gecko_group.add_argument("--leak-check", dest="leak_check", action="store_true", default=None,
                              help="Enable leak checking (enabled by default for debug builds, "
                              "silently ignored for opt, mobile)")
     gecko_group.add_argument("--no-leak-check", dest="leak_check", action="store_false", default=None,
                              help="Disable leak checking")
@@ -543,19 +541,16 @@ def check_args(kwargs):
             print("Preferences via --setpref must be in key=value format", file=sys.stderr)
             sys.exit(1)
         kwargs['extra_prefs'] = [tuple(prefarg.split('=', 1)) for prefarg in
                                  kwargs['extra_prefs']]
 
     if kwargs["reftest_internal"] is None:
         kwargs["reftest_internal"] = True
 
-    if kwargs["lsan_dir"] is None:
-        kwargs["lsan_dir"] = kwargs["prefs_root"]
-
     if kwargs["reftest_screenshot"] is None:
         kwargs["reftest_screenshot"] = "unexpected"
 
     if kwargs["enable_webrender"] is None:
         kwargs["enable_webrender"] = False
 
     return kwargs