Changeset 267206 in webkit
- Timestamp:
- Sep 17, 2020 1:21:33 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r267203 r267206 1 2020-09-17 David Kilzer <ddkilzer@apple.com> 2 3 WebKit::XPCServiceEventHandler block should call exit() on the main thread 4 <https://webkit.org/b/216594> 5 <rdar://problem/68053217> 6 7 Reviewed by Chris Dumez. 8 9 * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: 10 (WebKit::XPCServiceEventHandler): 11 - Call exit() on the main thread. I chose dispatch_sync() here 12 so that if other crashes occur on the main thread, we will 13 know if this background thread is waiting to call exit() at 14 the same time. Also, if a different background thread calls 15 exit() in the future with this block running on the main 16 thread, we'll know where the block came from since the XPC 17 handler thread will be waiting for the dispatch_sync() to 18 return (instead of having a mysterious block calling exit() on 19 the main thread and not knowing where it came from). 20 - Add logging (including simulated crash logs) when either of 21 these exit() code paths is taken. 22 1 23 2020-09-17 Hoa Dinh <dvh@apple.com> 2 24 -
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
r265715 r267206 27 27 28 28 #import "HandleXPCEndpointMessages.h" 29 #import "Logging.h" 29 30 #import "WKCrashReporter.h" 30 31 #import "XPCServiceEntryPoint.h" … … 48 49 if (type == XPC_TYPE_ERROR) { 49 50 if (event == XPC_ERROR_CONNECTION_INVALID || event == XPC_ERROR_TERMINATION_IMMINENT) { 51 RELEASE_LOG_FAULT(IPC, "Exiting: Received XPC event type: %s", event == XPC_ERROR_CONNECTION_INVALID ? "XPC_ERROR_CONNECTION_INVALID" : "XPC_ERROR_TERMINATION_IMMINENT"); 50 52 // FIXME: Handle this case more gracefully. 51 exit(EXIT_FAILURE); 53 dispatch_sync(dispatch_get_main_queue(), ^{ 54 exit(EXIT_FAILURE); 55 }); 52 56 } 53 57 } else { … … 73 77 InitializerFunction initializerFunctionPtr = reinterpret_cast<InitializerFunction>(CFBundleGetFunctionPointerForName(webKitBundle, entryPointFunctionName)); 74 78 if (!initializerFunctionPtr) { 75 NSLog(@"Unable to find entry point in WebKit.framework with name: %@", (__bridge NSString *)entryPointFunctionName); 76 exit(EXIT_FAILURE); 79 RELEASE_LOG_FAULT(IPC, "Exiting: Unable to find entry point in WebKit.framework with name: %s", [(__bridge NSString *)entryPointFunctionName UTF8String]); 80 dispatch_sync(dispatch_get_main_queue(), ^{ 81 exit(EXIT_FAILURE); 82 }); 77 83 } 78 84
Note: See TracChangeset
for help on using the changeset viewer.