Crash in NetworkProcessProxy::getNetworkProcessConnection() lambda due to missing Optional<> value check. NetworkProcess::createNetworkConnectionToWebProcess() can call its completion handler with an empty Optional<> argument: auto ipcConnection = createIPCConnectionPair(); if (!ipcConnection) { completionHandler({ }, HTTPCookieAcceptPolicy::Never); return; } The completion handler defined in NetworkProcessProxy::getNetworkProcessConnection() must be able to handle this. Note that GPUProcess::createGPUConnectionToWebProcess() and GPUProcessProxy::getGPUProcessConnection() have the same issue. <rdar://problem/64852903>
Created attachment 402999 [details] Patch v1
Comment on attachment 402999 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=402999&action=review > Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:186 > + sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply)](auto&& optionalConnectionIdentifier) mutable { I don’t think the renaming is helpful. The code already has * and -> in it every place this is used, so it’s not like we were overlooking that this was optional. We were just overlooking that it could actually be null. In fact, I’d probably rename it to just one word "identifier". > Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:136 > + sendWithAsyncReply(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply)](auto&& optionalConnectionIdentifier, auto cookieAcceptPolicy) mutable { Ditto.
Comment on attachment 402999 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=402999&action=review >> Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:186 >> + sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply)](auto&& optionalConnectionIdentifier) mutable { > > I don’t think the renaming is helpful. The code already has * and -> in it every place this is used, so it’s not like we were overlooking that this was optional. We were just overlooking that it could actually be null. In fact, I’d probably rename it to just one word "identifier". I'll rename this to "identifier". IMO, the type of every `auto` should be guessable on the line where it is declared, but I don't have the capacity or the desire to debate this. An IDE that would tell me the type of an `auto` variable would be amazing, though.
Created attachment 403090 [details] Patch for landing
Comment on attachment 403090 [details] Patch for landing Marking cq+ since there were no code changes from "Patch v1" and ios-wk2 is now passing.
Committed r263695: <https://trac.webkit.org/changeset/263695> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403090 [details].