Title: [245544] trunk/Tools
Revision
245544
Author
[email protected]
Date
2019-05-20 18:52:52 -0700 (Mon, 20 May 2019)

Log Message

run-webkit-tests not gathering crash logs on Cygwin Python and Windows Python
https://bugs.webkit.org/show_bug.cgi?id=179828

Reviewed by Jonathan Bedard.

ServerProcess should store its Windows PID for Cygwin before
process crashing because the Windows PID is required to get a
correct CrashLog.

CrashLog format has been changed. CrashLogs.GLOBAL_PID_REGEX
should accept the new format.

* Scripts/webkitpy/common/system/crashlogs.py:
(CrashLogs.GLOBAL_PID_REGEX): Accept any words between 'Global' and 'PID:'.

* Scripts/webkitpy/port/driver.py:
(Driver.has_crashed):
(Driver._check_for_driver_crash_or_unresponsiveness):
(Driver._read_block):
Store server_process.system_pid() to self._crashed_pid instead of server_process.pid().

* Scripts/webkitpy/port/server_process.py:
(ServerProcess.__init__):
(ServerProcess.system_pid): Added.
(ServerProcess._find_system_pid): Added.
(ServerProcess._start): Set self._system_pid.
* Scripts/webkitpy/port/win.py:
(WinPort._get_crash_log): Removed broken old code converting Cygwin pid to Windows pid.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (245543 => 245544)


--- trunk/Tools/ChangeLog	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/ChangeLog	2019-05-21 01:52:52 UTC (rev 245544)
@@ -1,3 +1,34 @@
+2019-05-20  Fujii Hironori  <[email protected]>
+
+        run-webkit-tests not gathering crash logs on Cygwin Python and Windows Python
+        https://bugs.webkit.org/show_bug.cgi?id=179828
+
+        Reviewed by Jonathan Bedard.
+
+        ServerProcess should store its Windows PID for Cygwin before
+        process crashing because the Windows PID is required to get a
+        correct CrashLog.
+
+        CrashLog format has been changed. CrashLogs.GLOBAL_PID_REGEX
+        should accept the new format.
+
+        * Scripts/webkitpy/common/system/crashlogs.py:
+        (CrashLogs.GLOBAL_PID_REGEX): Accept any words between 'Global' and 'PID:'.
+
+        * Scripts/webkitpy/port/driver.py:
+        (Driver.has_crashed):
+        (Driver._check_for_driver_crash_or_unresponsiveness):
+        (Driver._read_block):
+        Store server_process.system_pid() to self._crashed_pid instead of server_process.pid().
+
+        * Scripts/webkitpy/port/server_process.py:
+        (ServerProcess.__init__):
+        (ServerProcess.system_pid): Added.
+        (ServerProcess._find_system_pid): Added.
+        (ServerProcess._start): Set self._system_pid.
+        * Scripts/webkitpy/port/win.py:
+        (WinPort._get_crash_log): Removed broken old code converting Cygwin pid to Windows pid.
+
 2019-05-20  Aakash Jain  <[email protected]>
 
         Windows 10 test results missing on flakiness dashboard

Modified: trunk/Tools/Scripts/webkitpy/common/system/crashlogs.py (245543 => 245544)


--- trunk/Tools/Scripts/webkitpy/common/system/crashlogs.py	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/Scripts/webkitpy/common/system/crashlogs.py	2019-05-21 01:52:52 UTC (rev 245544)
@@ -37,7 +37,8 @@
 
 class CrashLogs(object):
 
-    GLOBAL_PID_REGEX = re.compile(r'\s+Global\s+PID:\s+\[(?P<pid>\d+)\]')
+    # Matches a string like '    Global    D1    PID: [14516]'
+    GLOBAL_PID_REGEX = re.compile(r'\s+Global\b.+\bPID:\s+\[(?P<pid>\d+)\]')
     EXIT_PROCESS_PID_REGEX = re.compile(r'Exit process \d+:(?P<pid>\w+), code')
     DARWIN_PROCESS_REGEX = re.compile(r'^Process:\s+(?P<process_name>.*) \[(?P<pid>\d+)\]$')
 

Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (245543 => 245544)


--- trunk/Tools/Scripts/webkitpy/port/driver.py	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py	2019-05-21 01:52:52 UTC (rev 245544)
@@ -387,7 +387,7 @@
             return True
         if self._server_process.has_crashed():
             self._crashed_process_name = self._server_process.process_name()
-            self._crashed_pid = self._server_process.pid()
+            self._crashed_pid = self._server_process.system_pid()
             return True
         return False
 
@@ -535,7 +535,7 @@
         crashed_check = error_line.rstrip('\r\n')
         if crashed_check == "#CRASHED":
             self._crashed_process_name = self._server_process.process_name()
-            self._crashed_pid = self._server_process.pid()
+            self._crashed_pid = self._server_process.system_pid()
             return True
         elif error_line.startswith("#CRASHED - "):
             match = re.match('#CRASHED - (\S+)', error_line)
@@ -693,7 +693,7 @@
 
         if asan_violation_detected and not self._crashed_process_name:
             self._crashed_process_name = self._server_process.process_name()
-            self._crashed_pid = self._server_process.pid()
+            self._crashed_pid = self._server_process.system_pid()
 
         block.decode_content()
         return block

Modified: trunk/Tools/Scripts/webkitpy/port/driver_unittest.py (245543 => 245544)


--- trunk/Tools/Scripts/webkitpy/port/driver_unittest.py	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/Scripts/webkitpy/port/driver_unittest.py	2019-05-21 01:52:52 UTC (rev 245544)
@@ -224,6 +224,9 @@
             def pid(self):
                 return 1234
 
+            def system_pid(self):
+                return self.pid()
+
             def process_name(self):
                 return 'FakeServerProcess'
 

Modified: trunk/Tools/Scripts/webkitpy/port/server_process.py (245543 => 245544)


--- trunk/Tools/Scripts/webkitpy/port/server_process.py	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/Scripts/webkitpy/port/server_process.py	2019-05-21 01:52:52 UTC (rev 245544)
@@ -77,6 +77,7 @@
         self._treat_no_data_as_crash = treat_no_data_as_crash
         self._target_host = target_host or port_obj.host
         self._pid = None
+        self._system_pid = None
         self._child_processes = {}
         self._reset()
 
@@ -93,6 +94,9 @@
     def pid(self):
         return self._pid
 
+    def system_pid(self):
+        return self._system_pid
+
     def _reset(self):
         if getattr(self, '_proc', None):
             if self._proc.stdin:
@@ -130,6 +134,7 @@
             env=self._env,
             universal_newlines=self._universal_newlines)
         self._pid = self._proc.pid
+        self._system_pid = int(self._port._filesystem.read_text_file('/proc/%d/winpid' % self._pid)) if self._port.host.platform.is_cygwin() else self._pid
         self._child_processes = {}
         if not self._use_win32_apis:
             self._set_file_nonblocking(self._proc.stdout)

Modified: trunk/Tools/Scripts/webkitpy/port/win.py (245543 => 245544)


--- trunk/Tools/Scripts/webkitpy/port/win.py	2019-05-21 01:36:11 UTC (rev 245543)
+++ trunk/Tools/Scripts/webkitpy/port/win.py	2019-05-21 01:52:52 UTC (rev 245544)
@@ -425,11 +425,7 @@
         _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:
-            # If the system_pid hasn't been determined yet, just try with the passed in pid.  We'll be checking again later
-            system_pid = self._executive.pid_to_system_pid.get(pid)
-            if system_pid == None:
-                break  # We haven't mapped cygwin pid->win pid yet
-            crash_log = crash_logs.find_newest_log(name, system_pid, include_errors=True, newer_than=newer_than)
+            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 line.startswith('quit:')]:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to