Bug 1039633 - Always try to set the ASan symbolizer in gtest runs. r=ted
authorAndrew McCreight <continuation@gmail.com>
Fri, 15 Aug 2014 11:10:53 -0700
changeset 199808 fd08e61066de9722826b84e2dd3dded073aa95d3
parent 199807 9dad28d06cb5326729ded0b8c9ecf1f42d7cf5b3
child 199809 8a00db3bafbd2ddd477a370ae96a54a40659bb3e
push id47738
push useramccreight@mozilla.com
push dateFri, 15 Aug 2014 18:11:08 +0000
treeherdermozilla-inbound@fd08e61066de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1039633
milestone34.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 1039633 - Always try to set the ASan symbolizer in gtest runs. r=ted
testing/gtest/rungtests.py
--- a/testing/gtest/rungtests.py
+++ b/testing/gtest/rungtests.py
@@ -81,16 +81,29 @@ class GTests(object):
             pathvar = "DYLD_LIBRARY_PATH"
         elif mozinfo.os == "win":
             pathvar = "PATH"
         if pathvar:
             if pathvar in env:
                 env[pathvar] = "%s%s%s" % (self.xre_path, os.pathsep, env[pathvar])
             else:
                 env[pathvar] = self.xre_path
+
+        # ASan specific environment stuff
+        # mozinfo is not set up properly to detect if ASan is enabled, so just always set these.
+        if mozinfo.isLinux or mozinfo.isMac:
+            # Symbolizer support
+            llvmsym = os.path.join(self.xre_path, "llvm-symbolizer")
+            if os.path.isfile(llvmsym):
+                env["ASAN_SYMBOLIZER_PATH"] = llvmsym
+                log.info("gtest | ASan using symbolizer at %s", llvmsym)
+            else:
+                # This should be |testFail| instead of |info|. See bug 1050891.
+                log.info("gtest | Failed to find ASan symbolizer at %s", llvmsym)
+
         return env
 
 class gtestOptions(OptionParser):
     def __init__(self):
         OptionParser.__init__(self)
         self.add_option("--xre-path",
                         action = "store", type = "string", dest = "xre_path",
                         default = None,