Changeset 220708 in webkit
- Timestamp:
- Aug 14, 2017 10:44:35 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r220705 r220708 1 2017-08-14 Jonathan Bedard <jbedard@apple.com> 2 3 sub-categorize Sandbox violation logs 4 https://bugs.webkit.org/show_bug.cgi?id=175536 5 <rdar://problem/33834416> 6 7 Reviewed by David Kilzer. 8 9 * Scripts/webkitpy/common/system/crashlogs.py: 10 (CrashLogs._parse_darwin_crash_log): Add 'Sandbox-' to the log name if the log is 11 a Sandbox violation. 12 (CrashLogs._find_all_logs_darwin): Update comment. 13 * Scripts/webkitpy/common/system/crashlogs_unittest.py: 14 (make_mock_sandbox_report_darwin): Create a Sandbox violation log for testing. 15 (CrashLogsTest.create_crash_logs_darwin): Add Sandbox violation to list of crashes. 16 (CrashLogsTest.test_find_all_log_darwin): 8 logs in testing instead of 7. 17 (CrashLogsTest.test_duplicate_log_darwin): Check for Sandbox violation log. 18 * Scripts/webkitpy/port/darwin.py: 19 (DarwinPort._merge_crash_logs): Handle Sandbox violation case. 20 1 21 2017-08-14 Daniel Bates <dabates@apple.com> 2 22 -
trunk/Tools/Scripts/webkitpy/common/system/crashlogs.py
r219088 r220708 63 63 if not contents: 64 64 return (None, None, None) 65 is_sandbox_violation = False 65 66 for line in contents.splitlines(): 67 if line.startswith('Sandbox Violation:'): 68 is_sandbox_violation = True 66 69 match = CrashLogs.DARWIN_PROCESS_REGEX.match(line) 67 70 if match: 68 return ( match.group('process_name'), int(match.group('pid')), contents)71 return (('Sandbox-' if is_sandbox_violation else '') + match.group('process_name'), int(match.group('pid')), contents) 69 72 return (None, None, contents) 70 73 … … 164 167 # Processes can remain running after Sandbox violations, which generate crash logs. 165 168 # This means that we can have mutliple crash logs attributed to the same process. 166 # The unique_name must be named in the format PROCESS_NAME-PID-# , where '-#' is optional.167 # This is because of how DarwinPort._merge_crash_logs parses the crash name.169 # The unique_name must be named in the format PROCESS_NAME-PID-# or Sandbox-PROCESS_NAME-PID-#, 170 # where '-#' is optional. This is because of how DarwinPort._merge_crash_logs parses the crash name. 168 171 count = 1 169 172 unique_name = result_name -
trunk/Tools/Scripts/webkitpy/common/system/crashlogs_unittest.py
r219088 r220708 71 71 PCI Card: NVIDIA GeForce GT 120, sppci_displaycontroller, MXM-Slot 72 72 Serial ATA Device: OPTIARC DVD RW AD-5670S 73 """.format(process_name=process_name, pid=pid) 74 75 76 def make_mock_sandbox_report_darwin(process_name, pid): 77 return """Incident Identifier: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 78 CrashReporter Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 79 Report Type: 187 80 Sandbox Violation: Sandbox: {process_name}({pid}) 81 82 {process_name}[{pid}] sandboxed. 83 size = 2513 84 container = <none> 85 sb_refcount = 2 86 profile = {process_name} 87 profile_refcount = 5 88 profile variables: 89 HOME -> 1 90 FRONT_USER_HOME -> 0 91 PROCESS_TEMP_DIR -> 2 92 93 Process: {process_name} [{pid}] 94 Path: /some/path/{process_name} 95 Load Address: 0x100c98000 96 Identifier: {process_name} 97 Version: xxxx.x.x (xxxx) 98 Code Type: arm64 (Native) 99 Parent Process: launchd.development [1] 100 User ID: xxx 101 102 Date/Time: 2017-08-09 13:46:21.203 PDT 103 OS Version: iOS 10.0 (14xxxx) 104 Report Version: 104 105 106 Thread 0 (id: xxxxxx): 107 0 libsystem_kernel.dylib 0x0000000182a91dbc 108 1 libsystem_pthread.dylib 0x0000000182ba2fb0 109 2 libsystem_pthread.dylib 0x0000000182ba2c30 110 111 Binary Images: 112 0x182a70000 - 0x182a97fff libsystem_kernel.dylib arm64 <1e5e0578f0db37e7bfa493945180cfcd> /usr/lib/system/libsystem_kernel.dylib 73 113 """.format(process_name=process_name, pid=pid) 74 114 … … 244 284 245 285 self.older_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree', 28528) 286 self.sandbox_crash_report = make_mock_sandbox_report_darwin('DumpRenderTree', 28530) 246 287 self.mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree', 28530) 247 288 self.newer_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree', 28529) … … 249 290 self.misformatted_mock_crash_report = 'Junk that should not appear in a crash report' + make_mock_crash_report_darwin('DumpRenderTree', 28526)[200:] 250 291 self.files = {} 251 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150716_quadzen.crash'] = self.older_mock_crash_report 252 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150717_quadzen_1.crash'] = self.older_mock_crash_report 253 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150718_quadzen_2.crash'] = self.older_mock_crash_report 292 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150715_quadzen.crash'] = self.older_mock_crash_report 293 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150716_quadzen_1.crash'] = self.older_mock_crash_report 294 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150717_quadzen_2.crash'] = self.older_mock_crash_report 295 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150718_quadzen.crash'] = self.sandbox_crash_report 254 296 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150719_quadzen.crash'] = self.mock_crash_report 255 297 self.files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06-13-150720_quadzen.crash'] = self.newer_mock_crash_report … … 270 312 crash_logs = self.create_crash_logs_darwin() 271 313 all_logs = crash_logs.find_all_logs() 272 self.assertEqual(len(all_logs), 7)314 self.assertEqual(len(all_logs), 8) 273 315 274 316 for test, crash_log in all_logs.iteritems(): 275 317 self.assertTrue(crash_log in self.files.values()) 276 self.assertTrue(test == "Unknown" or int(test.split("-")[1]) in range(28527, 28531)) 318 if test.split('-')[0] != 'Sandbox': 319 self.assertTrue(test == "Unknown" or int(test.split("-")[1]) in range(28527, 28531)) 277 320 278 321 def test_duplicate_log_darwin(self): … … 282 325 crash_logs = self.create_crash_logs_darwin() 283 326 all_logs = crash_logs.find_all_logs() 284 expected_logs = ['DumpRenderTree-28528', 'DumpRenderTree-28528-1', 'DumpRenderTree-28528-2', 327 expected_logs = ['DumpRenderTree-28528', 'DumpRenderTree-28528-1', 'DumpRenderTree-28528-2', 'Sandbox-DumpRenderTree-28530', 285 328 'DumpRenderTree-28529', 'DumpRenderTree-28530', 'FooProcess-28527', 'Unknown'] 286 329 -
trunk/Tools/Scripts/webkitpy/port/darwin.py
r217946 r220708 98 98 for test, crash_log in new_logs.iteritems(): 99 99 try: 100 process_name = test.split("-")[0] 101 pid = int(test.split("-")[1]) 100 if test.split('-')[0] == 'Sandbox': 101 process_name = test.split('-')[1] 102 pid = int(test.split('-')[2]) 103 else: 104 process_name = test.split('-')[0] 105 pid = int(test.split('-')[1]) 102 106 except IndexError: 103 107 continue
Note: See TracChangeset
for help on using the changeset viewer.