Bug 813650 - Part 1: Don't print minidump stackwalk output incrementally, so we can implement part 2 without changing log order; r=ted a=test-only
authorEd Morley <emorley@mozilla.com>
Sat, 01 Dec 2012 16:58:40 +0000
changeset 109937 1734a9aa8636c4887f978337f02964fa9c7a4a56
parent 109936 55fb16d078e607f9761e3ed63423cb236feae962
child 109938 c34cad5083fcb991420fb43cdb923f4f5003b5bc
push id67
push useremorley@mozilla.com
push dateTue, 18 Dec 2012 10:35:11 +0000
reviewersted, test-only
bugs813650
milestone17.0.1esrpre
Bug 813650 - Part 1: Don't print minidump stackwalk output incrementally, so we can implement part 2 without changing log order; r=ted a=test-only
build/automationutils.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -160,39 +160,41 @@ def checkForCrashes(dumpDir, symbolsPath
     # extract symbols to a temporary directory (which we'll delete after
     # processing all crashes)
     symbolsPath = tempfile.mkdtemp()
     zfile = ZipFileReader(symbolsFile)
     zfile.extractall(symbolsPath)
 
   try:
     for d in dumps:
-      log.info("PROCESS-CRASH | %s | application crashed (minidump found)", testName)
-      print "Crash dump filename: " + d
+      stackwalkOutput = []
+      stackwalkOutput.append("Crash dump filename: " + d)
       if symbolsPath and stackwalkPath and os.path.exists(stackwalkPath):
         # run minidump stackwalk
         p = subprocess.Popen([stackwalkPath, d, symbolsPath],
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
         (out, err) = p.communicate()
         if len(out) > 3:
           # minidump_stackwalk is chatty, so ignore stderr when it succeeds.
-          print out
+          stackwalkOutput.append(out)
         else:
-          print "stderr from minidump_stackwalk:"
-          print err
+          stackwalkOutput.append("stderr from minidump_stackwalk:")
+          stackwalkOutput.append(err)
         if p.returncode != 0:
-          print "minidump_stackwalk exited with return code %d" % p.returncode
+          stackwalkOutput.append("minidump_stackwalk exited with return code %d" % p.returncode)
       else:
         if not symbolsPath:
-          print "No symbols path given, can't process dump."
+          stackwalkOutput.append("No symbols path given, can't process dump.")
         if not stackwalkPath:
-          print "MINIDUMP_STACKWALK not set, can't process dump."
+          stackwalkOutput.append("MINIDUMP_STACKWALK not set, can't process dump.")
         elif stackwalkPath and not os.path.exists(stackwalkPath):
-          print "MINIDUMP_STACKWALK binary not found: %s" % stackwalkPath
+          stackwalkOutput.append("MINIDUMP_STACKWALK binary not found: %s" % stackwalkPath)
+      log.info("PROCESS-CRASH | %s | application crashed (minidump found)", testName)
+      print '\n'.join(stackwalkOutput)
       dumpSavePath = os.environ.get('MINIDUMP_SAVE_PATH', None)
       if dumpSavePath:
         shutil.move(d, dumpSavePath)
         print "Saved dump as %s" % os.path.join(dumpSavePath,
                                                 os.path.basename(d))
       else:
         os.remove(d)
       extra = os.path.splitext(d)[0] + ".extra"