Run output of debug builds through fix-linux-stack/fix-macosx-stack. (Bug 385248) r=ted
authorL. David Baron <dbaron@dbaron.org>
Mon, 10 Aug 2009 15:52:29 -0700
changeset 31310 219bd7354882c89bd5fd12a69cb83e85054e486c
parent 31309 929ccf18610341e7ed4cc331afd2ad3edc036fdf
child 31311 70190028e932c9ee1d15492370afacdc5b4ea0db
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs385248
milestone1.9.2a2pre
Run output of debug builds through fix-linux-stack/fix-macosx-stack. (Bug 385248) r=ted
build/Makefile.in
build/automation-build.mk
build/automation.py.in
layout/tools/reftest/runreftest.py
testing/mochitest/Makefile.in
testing/mochitest/runtests.py.in
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -92,9 +92,19 @@ ifdef ENABLE_TESTS
 libs:: bloaturls.txt
 	$(INSTALL) $< $(DIST)/bin
 
 # Install bloatcycle.html into dist/bin/res, for auto-cycling
 # of bloaturls.txt.  This is for browsers that can't do -f
 # autocycling of URLs.
 libs:: bloatcycle.html
 	$(INSTALL) $< $(DIST)/bin/res
+
+ifeq ($(OS_ARCH),Darwin)
+libs:: $(topsrcdir)/tools/rb/fix-macosx-stack.pl
+	$(INSTALL) $< $(DIST)/bin
 endif
+
+ifeq ($(OS_ARCH),Linux)
+libs:: $(topsrcdir)/tools/rb/fix-linux-stack.pl
+	$(INSTALL) $< $(DIST)/bin
+endif
+endif
--- a/build/automation-build.mk
+++ b/build/automation-build.mk
@@ -29,24 +29,31 @@ ABSOLUTE_TOPSRCDIR = $(call core_abspath
 
 AUTOMATION_PPARGS = 	\
 			-DBROWSER_PATH=$(browser_path) \
 			-DXPC_BIN_PATH=\"$(LIBXUL_DIST)/bin\" \
 			-DBIN_SUFFIX=\"$(BIN_SUFFIX)\" \
 			-DPROFILE_DIR=\"$(_PROFILE_DIR)\" \
 			-DCERTS_SRC_DIR=\"$(_CERTS_SRC_DIR)\" \
 			-DSYMBOLS_PATH=\"$(_SYMBOLS_PATH)\" \
+			-DPERL=\"$(PERL)\" \
 			$(NULL)
 
 ifeq ($(OS_ARCH),Darwin)
 AUTOMATION_PPARGS += -DIS_MAC=1
 else
 AUTOMATION_PPARGS += -DIS_MAC=0
 endif
 
+ifeq ($(OS_ARCH),Linux)
+AUTOMATION_PPARGS += -DIS_LINUX=1
+else
+AUTOMATION_PPARGS += -DIS_LINUX=0
+endif
+
 ifeq ($(MOZ_BUILD_APP),camino)
 AUTOMATION_PPARGS += -DIS_CAMINO=1
 else
 AUTOMATION_PPARGS += -DIS_CAMINO=0
 endif
 
 ifeq ($(host_os), cygwin)
 AUTOMATION_PPARGS += -DIS_CYGWIN=1
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -76,23 +76,25 @@ SCRIPT_DIR = os.path.abspath(os.path.rea
            "IS_DEBUG_BUILD",
            "SYMBOLS_PATH",
           ]
 
 # These are generated in mozilla/build/Makefile.in
 #expand DIST_BIN = __XPC_BIN_PATH__
 #expand IS_WIN32 = len("__WIN32__") != 0
 #expand IS_MAC = __IS_MAC__ != 0
+#expand IS_LINUX = __IS_LINUX__ != 0
 #ifdef IS_CYGWIN
 #expand IS_CYGWIN = __IS_CYGWIN__ == 1
 #else
 IS_CYGWIN = False
 #endif
 #expand IS_CAMINO = __IS_CAMINO__ != 0
 #expand BIN_SUFFIX = __BIN_SUFFIX__
+#expand PERL = __PERL__
 
 UNIXISH = not IS_WIN32 and not IS_MAC
 
 #expand DEFAULT_APP = "./" + __BROWSER_PATH__
 #expand CERTS_SRC_DIR = __CERTS_SRC_DIR__
 #expand IS_TEST_BUILD = __IS_TEST_BUILD__
 #expand IS_DEBUG_BUILD = __IS_DEBUG_BUILD__
 #expand SYMBOLS_PATH = __SYMBOLS_PATH__
@@ -588,27 +590,43 @@ def runApp(testURL, env, app, profileDir
 
   proc = Process([cmd] + args,
                  env = environment(env, xrePath = xrePath,
                                    crashreporter = not debuggerInfo),
                  stdout = outputPipe,
                  stderr = subprocess.STDOUT)
   log.info("INFO | automation.py | Application pid: %d", proc.pid)
 
+  stackFixerProcess = None
   if outputPipe is None:
     log.info("TEST-INFO: Not logging stdout or stderr due to debugger connection")
   else:
-    line = proc.stdout.readline()
+    logsource = proc.stdout
+    if IS_DEBUG_BUILD:
+      stackFixerCommand = None
+      if IS_MAC:
+        stackFixerCommand = "fix-macosx-stack.pl"
+      elif IS_LINUX:
+        stackFixerCommand = "fix-linux-stack.pl"
+      if stackFixerCommand is not None:
+        stackFixerProcess = Process([PERL, os.path.join(utilityPath, stackFixerCommand)], stdin=logsource, stdout=subprocess.PIPE)
+        logsource = stackFixerProcess.stdout
+
+    line = logsource.readline()
     while line != "":
       log.info(line.rstrip())
-      line = proc.stdout.readline()
+      line = logsource.readline()
 
   status = proc.wait()
   if status != 0:
     log.info("TEST-UNEXPECTED-FAIL | automation.py | Exited with code %d during test run", status)
+  if stackFixerProcess is not None:
+    status = stackFixerProcess.wait()
+    if status != 0:
+      log.info("TEST-UNEXPECTED-FAIL | automation.py | Stack fixer process exited with code %d during test run", status)
   log.info("INFO | automation.py | Application ran for: %s", str(datetime.now() - startTime))
 
   if checkForCrashes(os.path.join(profileDir, "minidumps"), symbolsPath):
     status = -1
 
   if IS_TEST_BUILD and runSSLTunnel:
     ssltunnelProcess.kill()
 
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -128,17 +128,17 @@ Are you executing $objdir/_tests/reftest
 
     # browser environment
     browserEnv = dict(os.environ)
 
     # These variables are necessary for correct application startup; change
     # via the commandline at your own risk.
     # NO_EM_RESTART: will do a '-silent' run instead.
     browserEnv["NO_EM_RESTART"] = "1"
-    browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
+    browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
     if automation.UNIXISH:
       browserEnv["LD_LIBRARY_PATH"] = options.xrePath
       browserEnv["MOZILLA_FIVE_HOME"] = options.xrePath
       browserEnv["GNOME_DISABLE_CRASH_DIALOG"] = "1"
 
     # Enable leaks detection to its own log file.
     leakLogFile = os.path.join(profileDir, "runreftest_leaks.log")
     browserEnv["XPCOM_MEM_BLOAT_LOG"] = leakLogFile
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -93,16 +93,24 @@ libs:: $(_SERV_FILES)
 # but that we need for the test harness
 TEST_HARNESS_BINS := \
   xpcshell$(BIN_SUFFIX) \
   ssltunnel$(BIN_SUFFIX) \
   certutil$(BIN_SUFFIX) \
   pk12util$(BIN_SUFFIX) \
   $(NULL)
 
+ifeq ($(OS_ARCH),Darwin)
+TEST_HARNESS_BINS += fix-macosx-stack.pl
+endif
+
+ifeq ($(OS_ARCH),Linux)
+TEST_HARNESS_BINS += fix-linux-stack.pl
+endif
+
 # Components / typelibs that don't get packaged with
 # the build, but that we need for the test harness.
 TEST_HARNESS_COMPONENTS := \
   test_necko.xpt \
   $(NULL)
 
 # We need the test plugin as some tests rely on it
 ifeq (Darwin,$(OS_TARGET))
--- a/testing/mochitest/runtests.py.in
+++ b/testing/mochitest/runtests.py.in
@@ -386,17 +386,17 @@ Are you executing $objdir/_tests/testing
 
   # browser environment
   browserEnv = dict(os.environ)
 
   # These variables are necessary for correct application startup; change
   # via the commandline at your own risk.
   # NO_EM_RESTART: will do a '-silent' run instead.
   browserEnv["NO_EM_RESTART"] = "1"
-  browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
+  browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
   appDir = os.path.dirname(options.app)
   if automation.UNIXISH:
     browserEnv["LD_LIBRARY_PATH"] = appDir
     browserEnv["MOZILLA_FIVE_HOME"] = appDir
     browserEnv["GNOME_DISABLE_CRASH_DIALOG"] = "1"
 
   for v in options.environment:
     ix = v.find("=")