Modified: trunk/Tools/ChangeLog (206939 => 206940)
--- trunk/Tools/ChangeLog 2016-10-07 22:14:41 UTC (rev 206939)
+++ trunk/Tools/ChangeLog 2016-10-07 22:17:06 UTC (rev 206940)
@@ -1,3 +1,15 @@
+2016-10-07 Jonathan Bedard <[email protected]>
+
+ Build fix for “Move functionality common to Darwin ports into a base class”
+ https://bugs.webkit.org/show_bug.cgi?id=160709
+
+ Unreviewed build fix.
+
+ * Scripts/webkitpy/port/ios.py:
+ (IOSSimulatorPort._get_crash_log): Added iOS implementation.
+ * Scripts/webkitpy/port/mac.py:
+ (MacPort._get_crash_log): Added Mac implementation.
+
2016-10-07 Chelsea Pugh <[email protected]>
Unreviewed. Added myself to the list of committers.
Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (206939 => 206940)
--- trunk/Tools/Scripts/webkitpy/port/ios.py 2016-10-07 22:14:41 UTC (rev 206939)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py 2016-10-07 22:17:06 UTC (rev 206940)
@@ -186,6 +186,44 @@
return False
return True
+ def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=time.time, sleep_fn=time.sleep, wait_for_log=True):
+ time_fn = time_fn or time.time
+ sleep_fn = sleep_fn or time.sleep
+
+ # FIXME: We should collect the actual crash log for DumpRenderTree.app because it includes more
+ # information (e.g. exception codes) than is available in the stack trace written to standard error.
+ stderr_lines = []
+ crashed_subprocess_name_and_pid = None # e.g. ('DumpRenderTree.app', 1234)
+ for line in (stderr or '').splitlines():
+ if not crashed_subprocess_name_and_pid:
+ match = self.SUBPROCESS_CRASH_REGEX.match(line)
+ if match:
+ crashed_subprocess_name_and_pid = (match.group('subprocess_name'), int(match.group('subprocess_pid')))
+ continue
+ stderr_lines.append(line)
+
+ if crashed_subprocess_name_and_pid:
+ return self._get_crash_log(crashed_subprocess_name_and_pid[0], crashed_subprocess_name_and_pid[1], stdout,
+ '\n'.join(stderr_lines), newer_than, time_fn, sleep_fn, wait_for_log)
+
+ # LayoutTestRelay crashed
+ _log.debug('looking for crash log for %s:%s' % (name, str(pid)))
+ crash_log = ''
+ crash_logs = CrashLogs(self.host)
+ now = time_fn()
+ deadline = now + 5 * int(self.get_option('child_processes', 1))
+ while not crash_log and now <= deadline:
+ crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than)
+ if not wait_for_log:
+ break
+ if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]:
+ sleep_fn(0.1)
+ now = time_fn()
+
+ if not crash_log:
+ return stderr, None
+ return stderr, crash_log
+
def _build_relay(self):
environment = self.host.copy_current_environment()
environment.disable_gcc_smartquotes()
Modified: trunk/Tools/Scripts/webkitpy/port/mac.py (206939 => 206940)
--- trunk/Tools/Scripts/webkitpy/port/mac.py 2016-10-07 22:14:41 UTC (rev 206939)
+++ trunk/Tools/Scripts/webkitpy/port/mac.py 2016-10-07 22:17:06 UTC (rev 206940)
@@ -162,6 +162,31 @@
def _check_port_build(self):
return not self.get_option('java') or self._build_java_test_support()
+ def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=None, sleep_fn=None, wait_for_log=True):
+ # Note that we do slow-spin here and wait, since it appears the time
+ # ReportCrash takes to actually write and flush the file varies when there are
+ # lots of simultaneous crashes going on.
+ # FIXME: Should most of this be moved into CrashLogs()?
+ time_fn = time_fn or time.time
+ sleep_fn = sleep_fn or time.sleep
+ crash_log = ''
+ crash_logs = CrashLogs(self.host)
+ now = time_fn()
+ # FIXME: delete this after we're sure this code is working ...
+ _log.debug('looking for crash log for %s:%s' % (name, str(pid)))
+ deadline = now + 5 * int(self.get_option('child_processes', 1))
+ while not crash_log and now <= deadline:
+ crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than)
+ if not wait_for_log:
+ break
+ if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]:
+ sleep_fn(0.1)
+ now = time_fn()
+
+ if not crash_log:
+ return (stderr, None)
+ return (stderr, crash_log)
+
def start_helper(self, pixel_tests=False):
helper_path = self._path_to_helper()
if not helper_path: