Changeset 178116 in webkit
- Timestamp:
- Jan 8, 2015 9:10:01 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r178113 r178116 1 2015-01-08 Alexey Proskuryakov <ap@apple.com> 2 3 When WebProcess is slow to respond to IPC, that's mistakenly reported as crash 4 https://bugs.webkit.org/show_bug.cgi?id=140218 5 6 Reviewed by Darin Adler. 7 8 * Scripts/webkitpy/port/driver.py: 9 (Driver.__init__): Removed _subprocess_was_unresponsive that was a modifier for 10 "process crashed" condition. These don't make sense together - it's either a crash 11 or a timeout, and we should detect those properly at a much lower level. 12 (Driver.run_test): Ditto. 13 (Driver._check_for_driver_crash_or_unresponsiveness): Split crash and unresponsiveness 14 cases. 15 16 * WebKitTestRunner/TestController.h: 17 * WebKitTestRunner/TestController.cpp: 18 (WTR::TestController::webProcessName): 19 (WTR::TestController::processDidCrash): 20 Factored out hardcoded child process names, as we now use these in two places. 21 22 * WebKitTestRunner/TestInvocation.cpp: 23 (WTR::TestInvocation::dumpWebProcessUnresponsiveness): Dump an accurate child 24 process name, so that it can be sampled (fixes sampling on Mavericks and above). 25 1 26 2015-01-08 Zan Dobersek <zdobersek@igalia.com> 2 27 -
trunk/Tools/Scripts/webkitpy/port/driver.py
r177722 r178116 140 140 self._driver_timed_out = False 141 141 142 # WebKitTestRunner can report back subprocesses that became unresponsive143 # This could mean they crashed.144 self._subprocess_was_unresponsive = False145 146 142 # stderr reading is scoped on a per-test (not per-block) basis, so we store the accumulated 147 143 # stderr output, as well as if we've seen #EOF on this driver instance. … … 214 210 pid_str = str(self._crashed_pid) if self._crashed_pid else "unknown pid" 215 211 crash_log = 'No crash log found for %s:%s.\n' % (self._crashed_process_name, pid_str) 216 # If we were unresponsive append a message informing there may not have been a crash.217 if self._subprocess_was_unresponsive:218 crash_log += 'Process failed to become responsive before timing out.\n'219 212 220 213 # Print stdout and stderr to the placeholder crash log; we want as much context as possible. … … 373 366 self._driver_timed_out = True 374 367 375 def _check_for_driver_crash (self, error_line):368 def _check_for_driver_crash_or_unresponsiveness(self, error_line): 376 369 if error_line == "#CRASHED\n": 377 370 self._crashed_process_name = self._server_process.name() 378 371 self._crashed_pid = self._server_process.pid() 379 elif (error_line.startswith("#CRASHED - ") 380 or error_line.startswith("#PROCESS UNRESPONSIVE - ")): 381 # WebKitTestRunner/LayoutTestRelay uses this to report that the subprocess (e.g. WebProcess) crashed. 382 match = re.match('#(?:CRASHED|PROCESS UNRESPONSIVE) - (\S+)', error_line) 372 return True 373 elif error_line.startswith("#CRASHED - "): 374 match = re.match('#CRASHED - (\S+)', error_line) 383 375 self._crashed_process_name = match.group(1) if match else 'WebProcess' 384 376 match = re.search('pid (\d+)', error_line) 385 pid = int(match.group(1)) if match else None 386 self._crashed_pid = pid 387 # FIXME: delete this after we're sure this code is working :) 388 _log.debug('%s crash, pid = %s, error_line = %s' % (self._crashed_process_name, str(pid), error_line)) 389 if error_line.startswith("#PROCESS UNRESPONSIVE - "): 390 self._subprocess_was_unresponsive = True 391 self._port.sample_process(self._crashed_process_name, self._crashed_pid) 392 # We want to show this since it's not a regular crash and probably we don't have a crash log. 393 self.error_from_test += error_line 377 self._crashed_pid = int(match.group(1)) if match else None 378 _log.debug('%s crash, pid = %s' % (self._crashed_process_name, str(self._crashed_pid))) 394 379 return True 395 return self.has_crashed() 380 elif error_line.startswith("#PROCESS UNRESPONSIVE - "): 381 match = re.match('#PROCESS UNRESPONSIVE - (\S+)', error_line) 382 child_process_name = match.group(1) if match else 'WebProcess' 383 match = re.search('pid (\d+)', error_line) 384 child_process_pid = int(match.group(1)) if match else None 385 _log.debug('%s is unresponsive, pid = %s' % (child_process_name, str(child_process_pid))) 386 self._driver_timed_out = True 387 if child_process_pid: 388 self._port.sample_process(child_process_name, child_process_pid) 389 self.error_from_test += error_line 390 return True 391 return False 396 392 397 393 def _command_from_driver_input(self, driver_input): … … 500 496 501 497 if err_line: 502 if self._check_for_driver_crash (err_line):498 if self._check_for_driver_crash_or_unresponsiveness(err_line): 503 499 break 504 500 self.error_from_test += err_line -
trunk/Tools/WebKitTestRunner/TestController.cpp
r177995 r178116 753 753 } 754 754 755 const char* TestController::webProcessName() 756 { 757 // FIXME: Find a way to not hardcode the process name. 758 #if PLATFORM(IOS) 759 return "com.apple.WebKit.WebContent"; 760 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080 761 return "com.apple.WebKit.WebContent.Development"; 762 #else 763 return "WebProcess"; 764 #endif 765 } 766 755 767 void TestController::updateWebViewSizeForTest(const TestInvocation& test) 756 768 { … … 1372 1384 #if PLATFORM(COCOA) 1373 1385 pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page()); 1374 // FIXME: Find a way to not hardcode the process name. 1375 #if PLATFORM(IOS) 1376 const char* processName = "com.apple.WebKit.WebContent"; 1377 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080 1378 const char* processName = "com.apple.WebKit.WebContent.Development"; 1386 fprintf(stderr, "#CRASHED - %s (pid %ld)\n", webProcessName(), static_cast<long>(pid)); 1379 1387 #else 1380 const char* processName = "WebProcess"; 1381 #endif 1382 fprintf(stderr, "#CRASHED - %s (pid %ld)\n", processName, static_cast<long>(pid)); 1383 #else 1384 fputs("#CRASHED - WebProcess\n", stderr); 1388 fprintf(stderr, "#CRASHED - %s\n", webProcessName()); 1385 1389 #endif 1386 1390 fflush(stderr); -
trunk/Tools/WebKitTestRunner/TestController.h
r177870 r178116 105 105 void reattachPageToWebProcess(); 106 106 107 static const char* webProcessName(); 108 107 109 WorkQueueManager& workQueueManager() { return m_workQueueManager; } 108 110 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r177870 r178116 202 202 void TestInvocation::dumpWebProcessUnresponsiveness(const char* errorMessage) 203 203 { 204 c onst char* errorMessageToStderr = 0;204 char errorMessageToStderr[1024]; 205 205 #if PLATFORM(COCOA) 206 char buffer[64];207 206 pid_t pid = WKPageGetProcessIdentifier(TestController::shared().mainWebView()->page()); 208 sprintf(buffer, "#PROCESS UNRESPONSIVE - WebProcess (pid %ld)\n", static_cast<long>(pid)); 209 errorMessageToStderr = buffer; 207 sprintf(errorMessageToStderr, "#PROCESS UNRESPONSIVE - %s (pid %ld)\n", TestController::webProcessName(), static_cast<long>(pid)); 210 208 #else 211 errorMessageToStderr = "#PROCESS UNRESPONSIVE - WebProcess";209 sprintf(errorMessageToStderr, "#PROCESS UNRESPONSIVE - %s", TestController::webProcessName()); 212 210 #endif 213 211
Note: See TracChangeset
for help on using the changeset viewer.