Skip to content

Commit

Permalink
Bank of America crashes on launch when using ServiceExtensions XPC se…
Browse files Browse the repository at this point in the history
…rvices

https://bugs.webkit.org/show_bug.cgi?id=267124
rdar://119993070

Reviewed by Wenson Hsieh.

Fix crash on launch of WebKit processes, if the process launcher is deleted early. Create the XPC connection
after we have verified that we have a process launcher, otherwise we will get a XPC misuse crash because
the connection will be deleted in a resumed state.

* Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::launchProcess):

Canonical link: https://commits.webkit.org/272686@main
  • Loading branch information
pvollan committed Jan 5, 2024
1 parent dd88d93 commit 9419ea9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,12 @@ static void launchWithExtensionKit(ProcessLauncher& processLauncher, ProcessLaun
return;
}
callOnMainRunLoop([weakProcessLauncher = weakProcessLauncher, name = name, process = RetainPtr<_SEExtensionProcess>(process)] {
auto connection = [process makeLibXPCConnectionError:nil];
auto launcher = weakProcessLauncher.get();
if (!launcher) {
[process invalidate];
return;
}
launcher->m_xpcConnection = connection;
launcher->m_xpcConnection = [process makeLibXPCConnectionError:nil];
launcher->m_process = WTFMove(process);
launcher->finishLaunchingProcess(name.characters());
});
Expand Down

0 comments on commit 9419ea9

Please sign in to comment.