Bug 1039633 - Always try to set the ASan symbolizer in gtest runs. r=ted, a=test-only
authorAndrew McCreight <continuation@gmail.com>
Fri, 15 Aug 2014 11:10:53 -0700
changeset 208327 e0e150f31ffe
parent 208326 92aead6bd5fb
child 208328 45953c4613d2
push id3826
push userryanvm@gmail.com
push date2014-08-18 20:39 +0000
treeherdermozilla-beta@45953c4613d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, test-only
bugs1039633
milestone32.0
Bug 1039633 - Always try to set the ASan symbolizer in gtest runs. r=ted, a=test-only
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,