Bug 483968 - talos should be able to get a stack trace from browser hangs. r=ted default tip
authorJulien Pagès <j.parkouss@gmail.com>
Tue, 08 Sep 2015 19:59:02 +0200
changeset 1010 c0de097a7159
parent 1009 3b94adbd66f1
push id699
push userj.parkouss@gmail.com
push dateTue, 08 Sep 2015 18:00:03 +0000
reviewersted
bugs483968
Bug 483968 - talos should be able to get a stack trace from browser hangs. r=ted
talos/talos_process.py
--- a/talos/talos_process.py
+++ b/talos/talos_process.py
@@ -1,15 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
 import logging
 import psutil
+import mozcrash
 from mozprocess import ProcessHandler
 from threading import Event
 
 from utils import TalosError
 
 
 class ProcessContext(object):
     """
@@ -85,16 +86,18 @@ def run_browser(command, timeout=None, o
     proc.run()
     try:
         context.process = psutil.Process(proc.pid)
         if on_started:
             on_started()
         # wait until we saw __endTimestamp in the proc output,
         # or the browser just terminated - or we have a timeout
         if not event.wait(timeout):
+            # try to extract the minidump stack if the browser hangs
+            mozcrash.kill_and_get_minidump(proc.pid)
             raise TalosError("timeout")
         if reader.got_end_timestamp:
             for i in range(1, wait_for_quit_timeout):
                 if proc.wait(1) is not None:
                     break
             if proc.poll() is None:
                 logging.info(
                     "Browser shutdown timed out after {0} seconds, terminating"