def processLine(self, msgLF): msgLF = stripBeeps(msgLF) if not self.timedOut: self.fullLog.append(msgLF) msg = msgLF.rstrip("\n") pidprefix = "INFO | automation.py | Application pid:" if self.pid is None and msg.startswith(pidprefix): self.pid = int(msg[len(pidprefix):]) theappPrefix = "theapp: " if self.theapp is None and msg.startswith(theappPrefix): self.theapp = msg[len(theappPrefix):] if msg == "Not expected to hang": self.expectedToHang = False if msg == "Not expected to leak": self.expectedToLeak = False if msg == "Allowed to render inconsistently" or msg.find("nscoord_MAX") != -1 or msg.find("nscoord_MIN") != -1: self.expectedToRenderInconsistently = True if msg.startswith("Rendered inconsistently") and not self.expectedToRenderInconsistently and self.nsassertionCount == 0: # Ignoring testcases with assertion failures (or nscoord_MAX warnings) because of bug 575011 and bug 265084, more or less. self.fuzzerComplained = True self.printAndLog(DOMI_MARKER + msg) if msg.startswith("Leaked until "): self.sawOMGLEAK = True self.printAndLog(DOMI_MARKER + msg) if msg.startswith("FAILURE:"): self.fuzzerComplained = True self.printAndLog(DOMI_MARKER + msg) if "[object nsXPCComponents_Classes" in msg: # See 'escalationAttempt' in fuzzer-combined.js # A successful attempt will output something like: # Release: [object nsXPCComponents_Classes] # Debug: [object nsXPCComponents_Classes @ 0x12036b880 (native @ 0x1203678d0)] self.fuzzerComplained = True self.printAndLog(DOMI_MARKER + "nsXPCComponents_Classes") if msg.find("###!!! ASSERTION") != -1: self.nsassertionCount += 1 newNonfatalAssertion = detect_assertions.scanLine(self.knownPath, msg) if newNonfatalAssertion and not (self.expectedToLeak and "ASSERTION: Component Manager being held past XPCOM shutdown" in msg): self.sawNewNonfatalAssertion = True self.printAndLog(DOMI_MARKER + newNonfatalAssertion) if msg.find("Foreground URLs are active") != -1 or msg.find("Entry added to loadgroup twice") != -1: # print "Ignoring memory leaks (bug 622315)" # testcase in comment 2 self.expectedToLeak = True if "nsCARenderer::Render failure" in msg: # print "Ignoring memory leaks (bug 840688)" self.expectedToLeak = True if "ASSERTION: Appshell already destroyed" in msg: # print "Ignoring memory leaks (bug 933730)" self.expectedToLeak = True if "Did not receive all required callbacks" in msg: # print "Ignoring memory leaks (bug 973384)" self.expectedToLeak = True if "leaking" in msg: # print "Ignoring memory leaks" self.expectedToLeak = True if self.nsassertionCount == 100: # print """domInteresting.py: not considering it a failure if browser hangs, because assertions # are slow with stack-printing on. # Please test in opt builds too, or fix the assertion bugs.""" self.expectedToHang = True if not self.mallocFailure and detect_malloc_errors.scanLine(msgLF): self.mallocFailure = True self.printAndLog(DOMI_MARKER + "Malloc is unhappy") if self.valgrind and valgrindComplaintRegexp.match(msg): if not self.sawValgrindComplaint: self.sawValgrindComplaint = True self.printAndLog(DOMI_MARKER + "First Valgrind complaint") if len(self.summaryLog) < 100: self.summaryLog.append(msgLF) if (msg.startswith("TEST-UNEXPECTED-FAIL | automation.py | application timed out") or msg.startswith("TEST-UNEXPECTED-FAIL | automation.py | application ran for longer") or "Shutdown too long, probably frozen, causing a crash" in msg): # A hang was caught by either automation.py or by RunWatchdog (toolkit/components/terminator/nsTerminator.cpp) self.timedOut = True if "goQuitApplication" in msg: self.expectChromeFailure = True if "JavaScript error: self-hosted" in msg: # Bug 1186741: ignore this and future chrome failures self.expectChromeFailure = True if (not self.expectChromeFailure) and chromeFailure(msg) and not knownChromeFailure(msg): self.printAndLog(DOMI_MARKER + msg) self.sawChromeFailure = True return msgLF
def baseLevel(runthis, timeout, knownPath, logPrefix, valgrind=False): if valgrind: runthis = ( inspectShell.constructVgCmdList(errorCode=VALGRIND_ERROR_EXIT_CODE) + valgrindSuppressions(knownPath) + runthis ) preexec_fn = ulimitSet if os.name == "posix" else None runinfo = timedRun.timed_run(runthis, timeout, logPrefix, preexec_fn=preexec_fn) sta = runinfo.sta if sta == timedRun.CRASHED: sps.grabCrashLog(runthis[0], runinfo.pid, logPrefix, True) lev = JS_FINE issues = [] sawAssertion = False if detect_malloc_errors.amiss(logPrefix): issues.append("malloc error") lev = max(lev, JS_MALLOC_ERROR) if valgrind and runinfo.rc == VALGRIND_ERROR_EXIT_CODE: issues.append("valgrind reported an error") lev = max(lev, JS_VG_AMISS) valgrindErrorPrefix = "==" + str(runinfo.pid) + "==" else: valgrindErrorPrefix = None def printNote(note): print "%%% " + note crashWatcher = detect_crashes.CrashWatcher(knownPath, False, printNote) with open(logPrefix + "-err.txt", "rb") as err: for line in err: assertionSeverity, assertionIsNew = detect_assertions.scanLine(knownPath, line) crashWatcher.processOutputLine(line.rstrip()) if assertionIsNew: issues.append(line.rstrip()) lev = max(lev, JS_NEW_ASSERT_OR_CRASH) if assertionSeverity == detect_assertions.FATAL_ASSERT: sawAssertion = True lev = max(lev, JS_KNOWN_CRASH) if valgrindErrorPrefix and line.startswith(valgrindErrorPrefix): issues.append(line.rstrip()) if sta == timedRun.CRASHED and not sawAssertion: crashWatcher.readCrashLog(logPrefix + "-crash.txt") if sawAssertion: # Ignore the crash log, since we've already seen a new assertion failure. pass elif crashWatcher.crashProcessor: crashFrom = " (from " + crashWatcher.crashProcessor + ")" if crashWatcher.crashIsKnown: issues.append("known crash" + crashFrom) lev = max(lev, JS_KNOWN_CRASH) else: issues.append("unknown crash" + crashFrom) lev = max(lev, JS_NEW_ASSERT_OR_CRASH) elif sta == timedRun.TIMED_OUT: issues.append("timed out") lev = max(lev, JS_TIMED_OUT) elif sta == timedRun.ABNORMAL and not (valgrind and runinfo.rc == VALGRIND_ERROR_EXIT_CODE): issues.append("abnormal exit") lev = max(lev, JS_ABNORMAL_EXIT) return (lev, issues, runinfo)
def processLine(self, msgLF): msgLF = stripBeeps(msgLF) msg = msgLF.rstrip("\n") self.crashWatcher.processOutputLine(msg) if self.crashWatcher.crashProcessor and len(self.summaryLog) < 300: self.summaryLog.append(msgLF) if len(self.fullLogHead) < 100000: self.fullLogHead.append(msgLF) pidprefix = "INFO | automation.py | Application pid:" if self.pid is None and msg.startswith(pidprefix): self.pid = int(msg[len(pidprefix):]) #print "Firefox pid: " + str(self.pid) theappPrefix = "theapp: " if self.theapp is None and msg.startswith(theappPrefix): self.theapp = msg[len(theappPrefix):] #print "self.theapp " + repr(self.theapp) if msg.find("FRC") != -1: self.FRClines.append(msgLF) if msg == "Not expected to hang": self.expectedToHang = False if msg == "Not expected to leak": self.expectedToLeak = False if msg == "Allowed to render inconsistently" or msg.find("nscoord_MAX") != -1 or msg.find("nscoord_MIN") != -1: self.expectedToRenderInconsistently = True if msg.startswith("Rendered inconsistently") and not self.expectedToRenderInconsistently and self.nsassertionCount == 0: # Ignoring testcases with assertion failures (or nscoord_MAX warnings) because of bug 575011 and bug 265084, more or less. self.fuzzerComplained = True self.printAndLog("@@@ " + msg) if msg.startswith("Leaked until "): self.sawOMGLEAK = True self.printAndLog("@@@ " + msg) if msg.startswith("FAILURE:"): self.fuzzerComplained = True self.printAndLog("@@@ " + msg) if "[object nsXPCComponents_Classes" in msg: # See 'escalationAttempt' in fuzzer-combined.js # A successful attempt will output something like: # Release: [object nsXPCComponents_Classes] # Debug: [object nsXPCComponents_Classes @ 0x12036b880 (native @ 0x1203678d0)] self.fuzzerComplained = True self.printAndLog("@@@ " + msg) if msg.find("###!!! ASSERTION") != -1: self.nsassertionCount += 1 if msg.find("Foreground URLs are active") != -1 or msg.find("Entry added to loadgroup twice") != -1: # print "Ignoring memory leaks (bug 622315)" # testcase in comment 2 self.expectedToLeak = True if "nsCARenderer::Render failure" in msg: # print "Ignoring memory leaks (bug 840688)" self.expectedToLeak = True if "ASSERTION: Appshell already destroyed" in msg: # print "Ignoring memory leaks (bug 933730)" self.expectedToLeak = True if "Did not receive all required callbacks" in msg: # print "Ignoring memory leaks (bug 973384)" self.expectedToLeak = True if "leaking" in msg: # print "Ignoring memory leaks" self.expectedToLeak = True if self.nsassertionCount == 100: # print "domInteresting.py: not considering it a failure if browser hangs, because assertions are slow with stack-printing on. Please test in opt builds too, or fix the assertion bugs." self.expectedToHang = True assertionSeverity, newAssertion = detect_assertions.scanLine(self.knownPath, msgLF) # Treat these fatal assertions as crashes. This lets us distinguish call sites and makes ASan signatures match. overlyGenericAssertion = ( "You can't dereference a NULL" in msg or ("Assertion failure: false," in msg) or ("Assertion failure: value" in msg and "BindingUtils.h" in msg) or ("Assertion failure: i < Length() (invalid array index)" in msg) ) newAssertion = newAssertion and ( not overlyGenericAssertion and not (self.expectedToLeak and "ASSERTION: Component Manager being held past XPCOM shutdown" in msg) and not (self.expectedToLeak and "Tear-off objects remain in hashtable at shutdown" in msg) and not ("Assertion failed: _cairo_status_is_error" in msg and sps.isWin) and # A frequent error that I cannot reproduce not ("JS_IsExceptionPending" in msg) and # Bug 735081, bug 735082 not (self.goingDownHard and sps.isWin) and # Bug 763182 True) if newAssertion: self.newAssertionFailure = True self.printAndLog("@@@ " + msg) if assertionSeverity == detect_assertions.FATAL_ASSERT: self.sawFatalAssertion = True self.goingDownHard = True if not overlyGenericAssertion: self.crashWatcher.crashIsKnown = True if not self.mallocFailure and detect_malloc_errors.scanLine(msgLF): self.mallocFailure = True self.printAndLog("@@@ Malloc is unhappy") if self.valgrind and valgrindComplaintRegexp.match(msg): if not self.sawValgrindComplaint: self.sawValgrindComplaint = True self.printAndLog("@@@ First Valgrind complaint") if len(self.summaryLog) < 100: self.summaryLog.append(msgLF) if (msg.startswith("TEST-UNEXPECTED-FAIL | automation.py | application timed out") or msg.startswith("TEST-UNEXPECTED-FAIL | automation.py | application ran for longer") or "Shutdown too long, probably frozen, causing a crash" in msg): # A hang was caught by either automation.py or by RunWatchdog (toolkit/components/terminator/nsTerminator.cpp) self.timedOut = True self.goingDownHard = True self.crashWatcher.crashIsKnown = True if "goQuitApplication" in msg: self.expectChromeFailure = True if "JavaScript error: self-hosted" in msg: # Bug 1186741: ignore this and future chrome failures self.expectChromeFailure = True if (not self.expectChromeFailure) and chromeFailure(msg) and not knownChromeFailure(msg): self.printAndLog("@@@ " + msg) self.sawChromeFailure = True return msgLF
def baseLevel(runthis, timeout, knownPath, logPrefix, valgrind=False): if valgrind: runthis = (inspectShell.constructVgCmdList( errorCode=VALGRIND_ERROR_EXIT_CODE) + valgrindSuppressions(knownPath) + runthis) preexec_fn = ulimitSet if os.name == 'posix' else None runinfo = timedRun.timed_run(runthis, timeout, logPrefix, preexec_fn=preexec_fn) sta = runinfo.sta if sta == timedRun.CRASHED: sps.grabCrashLog(runthis[0], runinfo.pid, logPrefix, True) lev = JS_FINE issues = [] sawAssertion = False if detect_malloc_errors.amiss(logPrefix): issues.append("malloc error") lev = max(lev, JS_MALLOC_ERROR) if valgrind and runinfo.rc == VALGRIND_ERROR_EXIT_CODE: issues.append("valgrind reported an error") lev = max(lev, JS_VG_AMISS) valgrindErrorPrefix = "==" + str(runinfo.pid) + "==" else: valgrindErrorPrefix = None def printNote(note): print "%%% " + note crashWatcher = detect_crashes.CrashWatcher(knownPath, False, printNote) with open(logPrefix + "-err.txt", "rb") as err: for line in err: assertionSeverity, assertionIsNew = detect_assertions.scanLine( knownPath, line) crashWatcher.processOutputLine(line.rstrip()) if assertionIsNew: issues.append(line.rstrip()) lev = max(lev, JS_NEW_ASSERT_OR_CRASH) if assertionSeverity == detect_assertions.FATAL_ASSERT: sawAssertion = True lev = max(lev, JS_KNOWN_CRASH) if valgrindErrorPrefix and line.startswith(valgrindErrorPrefix): issues.append(line.rstrip()) if sta == timedRun.CRASHED and not sawAssertion: crashWatcher.readCrashLog(logPrefix + "-crash.txt") if sawAssertion: # Ignore the crash log, since we've already seen a new assertion failure. pass elif crashWatcher.crashProcessor: crashFrom = " (from " + crashWatcher.crashProcessor + ")" if crashWatcher.crashIsKnown: issues.append("known crash" + crashFrom) lev = max(lev, JS_KNOWN_CRASH) else: issues.append("unknown crash" + crashFrom) lev = max(lev, JS_NEW_ASSERT_OR_CRASH) elif sta == timedRun.TIMED_OUT: issues.append("timed out") lev = max(lev, JS_TIMED_OUT) elif sta == timedRun.ABNORMAL and not (valgrind and runinfo.rc == VALGRIND_ERROR_EXIT_CODE): issues.append("abnormal exit") lev = max(lev, JS_ABNORMAL_EXIT) return (lev, issues, runinfo)