WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 04:23:49 +0000 (04:23 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 04:23:49 +0000 (04:23 +0000)
commit103fb610ba49c122d8e340d9acd30a011b518749
treec5704b05b812f3524ddf8db8f6ab905db0fef7e5
parentd66b52541ecb445fda6c0d2b871d26dde69a248b
WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=191797

Reviewed by Ryosuke Niwa.

We were hitting the assertion because the error handler was first getting called. It would
deallocate the send right, cancel/null out the XPC connection and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()).

Then the xpc_connection_send_message_with_reply() block would get called later and
would try to deallocate the send right again, and call
didFinishLaunchingProcess(0, IPC::Connection::Identifier()) again because the xpc
connection is null.

Handle this case by having the xpc_connection_send_message_with_reply() block check
that we're still launching (i.e. didFinishLaunchingProcess() has not been called
yet).

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm