Only use a related page's process if that page has not been closed yet. Otherwise, this will lead to crashes like so: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 JavaScriptCore 0x0000000105e6974b Inspector::RemoteInspector::updateTarget(Inspector::RemoteControllableTarget*) + 43 (RemoteControllableTarget.h:53) 1 com.apple.WebKit 0x0000000106c3ea43 WebKit::WebPageProxy::finishAttachingToWebProcess(WebKit::WebPageProxy::IsProcessSwap) + 125 (memory:2621) 2 com.apple.WebKit 0x0000000106c3e93f WebKit::WebPageProxy::launchProcess(WebCore::RegistrableDomain const&) + 411 3 com.apple.WebKit 0x0000000106c3e98d WebKit::WebPageProxy::ensureRunningProcess() + 43 (utility:925) 4 com.apple.WebKit 0x0000000106c3e8b4 WebKit::WebPageProxy::launchProcess(WebCore::RegistrableDomain const&) + 272 5 com.apple.WebKit 0x0000000106c3f3fa WebKit::WebPageProxy::launchProcessForReload() + 526 (DumbPtrTraits.h:41) 6 com.apple.WebKit 0x0000000106c439d7 WebKit::WebPageProxy::reload(WTF::OptionSet<WebCore::ReloadOption>) + 493 7 com.apple.WebKit 0x0000000106bad8da -[WKWebView reload] + 55 (RefPtr.h:87) 8 TestWebKitAPI 0x000000010504541e invocation function for block in ProcessSwap_ReloadRelatedWebViewAfterCrash_Test::TestBody() + 28 (ProcessSwapOnNavigation.mm:4727) 9 com.apple.WebKit 0x0000000106c12f42 WebKit::NavigationState::NavigationClient::processDidTerminate(WebKit::WebPageProxy&, WebKit::ProcessTerminationReason) + 166 (RetainPtr.h:170) 10 com.apple.WebKit 0x0000000106c59645 WebKit::WebPageProxy::dispatchProcessDidTerminate(WebKit::ProcessTerminationReason) + 209 (WebPageProxy.cpp:6776) 11 com.apple.WebKit 0x0000000106c48e2a WebKit::WebPageProxy::processDidTerminate(WebKit::ProcessTerminationReason) + 682 (WebPageProxy.cpp:6738) 12 com.apple.WebKit 0x0000000106c88b9b WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch() + 1063 (WebProcessProxy.cpp:691) 13 com.apple.WebKit 0x0000000106c88747 WebKit::WebProcessProxy::didClose(IPC::Connection&) + 125 14 JavaScriptCore 0x00000001058fe2f4 WTF::RunLoop::performWork() + 228 15 JavaScriptCore 0x00000001058fe582 WTF::RunLoop::performWork(void*) + 34 (RunLoopCF.cpp:39) 16 com.apple.CoreFoundation 0x000000010d6a9631 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 17 com.apple.CoreFoundation 0x000000010d6a95c1 __CFRunLoopDoSource0 + 81 18 com.apple.CoreFoundation 0x000000010d6a8d94 __CFRunLoopDoSources0 + 180 19 com.apple.CoreFoundation 0x000000010d6a3aaf __CFRunLoopRun + 1263 20 com.apple.CoreFoundation 0x000000010d6a3296 CFRunLoopRunSpecific + 438 21 com.apple.Foundation 0x000000010cfc37c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 211 22 TestWebKitAPI 0x00000001050dd429 TestWebKitAPI::Util::run(bool*) + 106 (UtilitiesCocoa.mm:34) 23 TestWebKitAPI 0x0000000105045212 ProcessSwap_ReloadRelatedWebViewAfterCrash_Test::TestBody() + 1144 (ProcessSwapOnNavigation.mm:4766) 24 TestWebKitAPI 0x000000010516be97 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 72 25 TestWebKitAPI 0x000000010516be00 testing::Test::Run() + 184 26 TestWebKitAPI 0x000000010516c72d testing::TestInfo::Run() + 199 27 TestWebKitAPI 0x000000010516cd3b testing::TestCase::Run() + 249 28 TestWebKitAPI 0x0000000105174bee testing::internal::UnitTestImpl::RunAllTests() + 654 29 TestWebKitAPI 0x0000000105174849 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) + 72 30 TestWebKitAPI 0x00000001051747d4 testing::UnitTest::Run() + 108 31 TestWebKitAPI 0x00000001050b4b7a TestWebKitAPI::TestsController::run(int, char**) + 120 (TestsController.cpp:86) 32 TestWebKitAPI 0x000000010514adb1 main + 287 (mai
<rdar://problem/50302423>
Created attachment 368515 [details] Patch
ping review?
Comment on attachment 368515 [details] Patch Clearing flags on attachment: 368515 Committed r244799: <https://trac.webkit.org/changeset/244799>
All reviewed patches have been landed. Closing bug.