Skip to content

Commit

Permalink
The crashy WebKit XPC service causes Safari to Crash on iOS
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247395
rdar://101876374

Reviewed by Chris Dumez.

When calling sendToAllProcessesForSession(), we should ignore crashy WebProcesses.
Also fixed WebContent.Crashy configuration for iOS so that we install the service and don't
change the code signing flags.

* Source/WebKit/Configurations/WebContentService.Crashy.xcconfig:
* Source/WebKit/UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToAllProcessesForSession):
* Source/WebKit/UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::isCrashyProcess const):
(WebKit::WebProcessProxy::isCrashyProcess): Deleted.

Canonical link: https://commits.webkit.org/256434@main
  • Loading branch information
msaboff committed Nov 8, 2022
1 parent fc20b78 commit 2fb42dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Expand Up @@ -25,11 +25,6 @@

SKIP_INSTALL = YES;
SKIP_INSTALL[sdk=macosx*] = $(WK_RELOCATABLE_FRAMEWORKS);
SKIP_INSTALL[sdk=iphone*] = NO;

WK_XPC_SERVICE_VARIANT = Crashy;

WK_USE_RESTRICTED_ENTITLEMENTS = NO;

WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iphoneos = ;
WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_appletvos = ;
WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_watchos = ;
4 changes: 4 additions & 0 deletions Source/WebKit/UIProcess/WebProcessPool.h
Expand Up @@ -845,6 +845,10 @@ template<typename T>
void WebProcessPool::sendToAllProcessesForSession(const T& message, PAL::SessionID sessionID)
{
for (auto& process : m_processes) {
#if ENABLE(WEBCONTENT_CRASH_TESTING)
if (process->isCrashyProcess())
continue;
#endif
if (process->canSendMessage() && !process->isPrewarmed() && process->sessionID() == sessionID)
process->send(T(message), 0);
}
Expand Down
5 changes: 4 additions & 1 deletion Source/WebKit/UIProcess/WebProcessProxy.h
Expand Up @@ -218,6 +218,10 @@ class WebProcessProxy : public AuxiliaryProcessProxy, private ProcessThrottlerCl

bool isDummyProcessProxy() const;

#if ENABLE(WEBCONTENT_CRASH_TESTING)
bool isCrashyProcess() const { return m_isWebContentCrashyProcess; }
#endif

void didCreateWebPageInProcess(WebCore::PageIdentifier);

void addVisitedLinkStoreUser(VisitedLinkStore&, WebPageProxyIdentifier);
Expand Down Expand Up @@ -487,7 +491,6 @@ class WebProcessProxy : public AuxiliaryProcessProxy, private ProcessThrottlerCl
void validateFreezerStatus();

#if ENABLE(WEBCONTENT_CRASH_TESTING)
bool isCrashyProcess() { return m_isWebContentCrashyProcess; }
void setIsCrashyProcess() { m_isWebContentCrashyProcess = true; }
#endif

Expand Down

0 comments on commit 2fb42dc

Please sign in to comment.