Changeset 243711 in webkit
- Timestamp:
- Apr 1, 2019 1:52:36 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243708 r243711 1 2019-04-01 Chris Dumez <cdumez@apple.com> 2 3 UIProcess crash when a prewarmed process is terminated 4 https://bugs.webkit.org/show_bug.cgi?id=196451 5 <rdar://problem/49245471> 6 7 Reviewed by Geoffrey Garen. 8 9 Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer 10 true after r243384. For example, prewarmed WebContent processe do not get a data store 11 until they actually get used. 12 13 * UIProcess/API/Cocoa/WKProcessPool.mm: 14 (-[WKProcessPool _prewarmedProcessIdentifier]): 15 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 16 * UIProcess/WebProcessPool.cpp: 17 (WebKit::WebProcessPool::networkProcessIdentifier): 18 (WebKit::WebProcessPool::prewarmedProcessIdentifier): 19 * UIProcess/WebProcessPool.h: 20 * UIProcess/WebProcessProxy.cpp: 21 (WebKit::WebProcessProxy::didClose): 22 (WebKit::WebProcessProxy::didFinishLaunching): 23 (WebKit::WebProcessProxy::requestTermination): 24 (WebKit::WebProcessProxy::isReleaseLoggingAllowed const): 25 * UIProcess/WebProcessProxy.h: 26 1 27 2019-04-01 Patrick Griffis <pgriffis@igalia.com> 2 28 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
r243384 r243711 441 441 } 442 442 443 - (pid_t)_prewarmedProcessIdentifier 444 { 445 return _processPool->prewarmedProcessIdentifier(); 446 } 447 448 443 449 - (void)_syncNetworkProcessCookies 444 450 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
r243376 r243711 90 90 // Test only. 91 91 - (pid_t)_networkProcessIdentifier WK_API_AVAILABLE(macos(10.13), ios(11.0)); 92 - (pid_t)_prewarmedProcessIdentifier WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 92 93 93 94 // Test only. -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r243562 r243711 1441 1441 ProcessID WebProcessPool::networkProcessIdentifier() 1442 1442 { 1443 if (!m_networkProcess) 1444 return 0; 1445 1446 return m_networkProcess->processIdentifier(); 1443 return m_networkProcess ? m_networkProcess->processIdentifier() : 0; 1444 } 1445 1446 ProcessID WebProcessPool::prewarmedProcessIdentifier() 1447 { 1448 return m_prewarmedProcess ? m_prewarmedProcess->processIdentifier() : 0; 1447 1449 } 1448 1450 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r243384 r243711 233 233 234 234 ProcessID networkProcessIdentifier(); 235 ProcessID prewarmedProcessIdentifier(); 235 236 void activePagesOriginsInWebProcessForTesting(ProcessID, CompletionHandler<void(Vector<String>&&)>&&); 236 237 bool networkProcessHasEntitlementForTesting(const String&); -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r243388 r243711 649 649 void WebProcessProxy::didClose(IPC::Connection&) 650 650 { 651 RELEASE_LOG_IF( m_websiteDataStore->sessionID().isAlwaysOnLoggingAllowed(), Process, "%p - WebProcessProxy didClose (web process crash)", this);651 RELEASE_LOG_IF(isReleaseLoggingAllowed(), Process, "%p - WebProcessProxy didClose (web process crash)", this); 652 652 processDidTerminateOrFailedToLaunch(); 653 653 } … … 758 758 759 759 if (!IPC::Connection::identifierIsValid(connectionIdentifier)) { 760 RELEASE_LOG_IF( m_websiteDataStore->sessionID().isAlwaysOnLoggingAllowed(), Process, "%p - WebProcessProxy didFinishLaunching - invalid connection identifier (web process failed to launch)", this);760 RELEASE_LOG_IF(isReleaseLoggingAllowed(), Process, "%p - WebProcessProxy didFinishLaunching - invalid connection identifier (web process failed to launch)", this); 761 761 processDidTerminateOrFailedToLaunch(); 762 762 return; … … 985 985 986 986 auto protectedThis = makeRef(*this); 987 RELEASE_LOG_IF( m_websiteDataStore->sessionID().isAlwaysOnLoggingAllowed(), Process, "%p - WebProcessProxy::requestTermination - reason %d", this, reason);987 RELEASE_LOG_IF(isReleaseLoggingAllowed(), Process, "%p - WebProcessProxy::requestTermination - reason %d", this, reason); 988 988 989 989 AuxiliaryProcessProxy::terminate(); … … 998 998 for (auto& page : pages) 999 999 page->processDidTerminate(reason); 1000 } 1001 1002 bool WebProcessProxy::isReleaseLoggingAllowed() const 1003 { 1004 return !m_websiteDataStore || m_websiteDataStore->sessionID().isAlwaysOnLoggingAllowed(); 1000 1005 } 1001 1006 -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r243630 r243711 359 359 void processDidTerminateOrFailedToLaunch(); 360 360 361 bool isReleaseLoggingAllowed() const; 362 361 363 // IPC::Connection::Client 362 364 friend class WebConnectionToWebProcess; -
trunk/Tools/ChangeLog
r243707 r243711 1 2019-04-01 Chris Dumez <cdumez@apple.com> 2 3 UIProcess crash when a prewarmed process is terminated 4 https://bugs.webkit.org/show_bug.cgi?id=196451 5 <rdar://problem/49245471> 6 7 Reviewed by Geoffrey Garen. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessPreWarming.mm: 12 (TEST): 13 1 14 2019-04-01 Aakash Jain <aakash_jain@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessPreWarming.mm
r243384 r243711 121 121 EXPECT_EQ(2U, [pool _webPageContentProcessCount]); 122 122 } 123 124 TEST(WKProcessPool, PrewarmedProcessCrash) 125 { 126 auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 127 processPoolConfiguration.get().prewarmsProcessesAutomatically = NO; 128 129 auto pool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 130 [pool _warmInitialProcess]; 131 132 EXPECT_TRUE([pool _hasPrewarmedWebProcess]); 133 EXPECT_EQ(1U, [pool _webPageContentProcessCount]); 134 135 // Wait for prewarmed process to finish launching. 136 while (![pool _prewarmedProcessIdentifier]) 137 TestWebKitAPI::Util::sleep(0.01); 138 139 kill([pool _prewarmedProcessIdentifier], 9); 140 141 while ([pool _hasPrewarmedWebProcess]) 142 TestWebKitAPI::Util::sleep(0.01); 143 }
Note: See TracChangeset
for help on using the changeset viewer.