mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 855681 - Try to get stacks from child processes that were alive after shutdown; r=ted
This commit is contained in:
parent
042230d0b4
commit
a7798a74c7
@ -908,7 +908,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
|
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
|
||||||
return ('', False)
|
return ('', False)
|
||||||
else:
|
else:
|
||||||
log.error("readWithTimeout got error: %d", err)
|
self.log.error("readWithTimeout got error: %d", err)
|
||||||
if l.value > 0:
|
if l.value > 0:
|
||||||
# we're assuming that the output is line-buffered,
|
# we're assuming that the output is line-buffered,
|
||||||
# which is not unreasonable
|
# which is not unreasonable
|
||||||
@ -932,7 +932,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
pHandle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, 0, pid)
|
pHandle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, 0, pid)
|
||||||
if not pHandle:
|
if not pHandle:
|
||||||
return
|
return
|
||||||
success = ctypes.windll.kernel32.TerminateProcess(pHandle, 1)
|
ctypes.windll.kernel32.TerminateProcess(pHandle, 1)
|
||||||
ctypes.windll.kernel32.CloseHandle(pHandle)
|
ctypes.windll.kernel32.CloseHandle(pHandle)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -1014,7 +1014,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
encoded = base64.b64encode(image)
|
encoded = base64.b64encode(image)
|
||||||
self.log.info("SCREENSHOT: data:image/png;base64,%s", encoded)
|
self.log.info("SCREENSHOT: data:image/png;base64,%s", encoded)
|
||||||
|
|
||||||
def killAndGetStack(self, proc, utilityPath, debuggerInfo):
|
def killAndGetStack(self, processPID, utilityPath, debuggerInfo):
|
||||||
"""Kill the process, preferrably in a way that gets us a stack trace."""
|
"""Kill the process, preferrably in a way that gets us a stack trace."""
|
||||||
if not debuggerInfo:
|
if not debuggerInfo:
|
||||||
if self.haveDumpedScreen:
|
if self.haveDumpedScreen:
|
||||||
@ -1025,16 +1025,16 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
if self.CRASHREPORTER and not debuggerInfo:
|
if self.CRASHREPORTER and not debuggerInfo:
|
||||||
if self.UNIXISH:
|
if self.UNIXISH:
|
||||||
# ABRT will get picked up by Breakpad's signal handler
|
# ABRT will get picked up by Breakpad's signal handler
|
||||||
os.kill(proc.pid, signal.SIGABRT)
|
os.kill(processPID, signal.SIGABRT)
|
||||||
return
|
return
|
||||||
elif self.IS_WIN32:
|
elif self.IS_WIN32:
|
||||||
# We should have a "crashinject" program in our utility path
|
# We should have a "crashinject" program in our utility path
|
||||||
crashinject = os.path.normpath(os.path.join(utilityPath, "crashinject.exe"))
|
crashinject = os.path.normpath(os.path.join(utilityPath, "crashinject.exe"))
|
||||||
if os.path.exists(crashinject) and subprocess.Popen([crashinject, str(proc.pid)]).wait() == 0:
|
if os.path.exists(crashinject) and subprocess.Popen([crashinject, str(processPID)]).wait() == 0:
|
||||||
return
|
return
|
||||||
#TODO: kill the process such that it triggers Breakpad on OS X (bug 525296)
|
#TODO: kill the process such that it triggers Breakpad on OS X (bug 525296)
|
||||||
self.log.info("Can't trigger Breakpad, just killing process")
|
self.log.info("Can't trigger Breakpad, just killing process")
|
||||||
proc.kill()
|
self.killPid(processPID)
|
||||||
|
|
||||||
def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime, debuggerInfo, symbolsPath):
|
def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime, debuggerInfo, symbolsPath):
|
||||||
""" Look for timeout or crashes and return the status after the process terminates """
|
""" Look for timeout or crashes and return the status after the process terminates """
|
||||||
@ -1086,10 +1086,10 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
# Kill the application, but continue reading from stack fixer so as not to deadlock on stackFixerProcess.wait().
|
# Kill the application, but continue reading from stack fixer so as not to deadlock on stackFixerProcess.wait().
|
||||||
hitMaxTime = True
|
hitMaxTime = True
|
||||||
self.log.info("TEST-UNEXPECTED-FAIL | %s | application ran for longer than allowed maximum time of %d seconds", self.lastTestSeen, int(maxTime))
|
self.log.info("TEST-UNEXPECTED-FAIL | %s | application ran for longer than allowed maximum time of %d seconds", self.lastTestSeen, int(maxTime))
|
||||||
self.killAndGetStack(proc, utilityPath, debuggerInfo)
|
self.killAndGetStack(proc.pid, utilityPath, debuggerInfo)
|
||||||
if didTimeout:
|
if didTimeout:
|
||||||
self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output", self.lastTestSeen, int(timeout))
|
self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output", self.lastTestSeen, int(timeout))
|
||||||
self.killAndGetStack(proc, utilityPath, debuggerInfo)
|
self.killAndGetStack(proc.pid, utilityPath, debuggerInfo)
|
||||||
|
|
||||||
status = proc.wait()
|
status = proc.wait()
|
||||||
if status == 0:
|
if status == 0:
|
||||||
@ -1135,7 +1135,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
args.extend(extraArgs)
|
args.extend(extraArgs)
|
||||||
return cmd, args
|
return cmd, args
|
||||||
|
|
||||||
def checkForZombies(self, processLog):
|
def checkForZombies(self, processLog, utilityPath, debuggerInfo):
|
||||||
""" Look for hung processes """
|
""" Look for hung processes """
|
||||||
if not os.path.exists(processLog):
|
if not os.path.exists(processLog):
|
||||||
self.log.info('Automation Error: PID log not found: %s', processLog)
|
self.log.info('Automation Error: PID log not found: %s', processLog)
|
||||||
@ -1159,7 +1159,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
if self.isPidAlive(processPID):
|
if self.isPidAlive(processPID):
|
||||||
foundZombie = True
|
foundZombie = True
|
||||||
self.log.info("TEST-UNEXPECTED-FAIL | zombiecheck | child process %d still alive after shutdown", processPID)
|
self.log.info("TEST-UNEXPECTED-FAIL | zombiecheck | child process %d still alive after shutdown", processPID)
|
||||||
self.killPid(processPID)
|
self.killAndGetStack(processPID, utilityPath, debuggerInfo)
|
||||||
return foundZombie
|
return foundZombie
|
||||||
|
|
||||||
def checkForCrashes(self, profileDir, symbolsPath):
|
def checkForCrashes(self, profileDir, symbolsPath):
|
||||||
@ -1235,7 +1235,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
|||||||
self.log.info("INFO | automation.py | Application ran for: %s", str(datetime.now() - startTime))
|
self.log.info("INFO | automation.py | Application ran for: %s", str(datetime.now() - startTime))
|
||||||
|
|
||||||
# Do a final check for zombie child processes.
|
# Do a final check for zombie child processes.
|
||||||
zombieProcesses = self.checkForZombies(processLog)
|
zombieProcesses = self.checkForZombies(processLog, utilityPath, debuggerInfo)
|
||||||
|
|
||||||
crashed = self.checkForCrashes(profileDir, symbolsPath)
|
crashed = self.checkForCrashes(profileDir, symbolsPath)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user