Revert upstream commit:

28d9d62aa2

This prevents a crash at exit time for any application using WebkitGTK.

debuged by & ok robert@
This commit is contained in:
ajacoutot 2022-03-29 07:16:26 +00:00
parent 32a47609bf
commit 1b0ffe7b11
5 changed files with 115 additions and 0 deletions

View File

@ -14,6 +14,7 @@ COMMENT = GTK+ port of the WebKit rendering engine
V = 2.36.0
DISTNAME = webkitgtk-${V}
PKGNAME = webkitgtk4-${V}
REVISION = 0
EXTRACT_SUFX = .tar.xz
API = 4.0

View File

@ -0,0 +1,24 @@
REVERT: https://github.com/WebKit/WebKit/commit/28d9d62aa2662266c2d9cb0032b036a257c6c8ab
This prevents a crash at exit time for any application using WebkitGTK.
From 28d9d62aa2662266c2d9cb0032b036a257c6c8ab Mon Sep 17 00:00:00 2001
From: Pablo Saavedra <psaavedra@igalia.com>
Date: Wed, 23 Feb 2022 09:32:13 +0000
Subject: [PATCH] [GTK][WPE] PlatformDisplay::terminateEglDisplays() is never called https://bugs.webkit.org/show_bug.cgi?id=217655
Index: Source/WebKit/Shared/AuxiliaryProcess.cpp
--- Source/WebKit/Shared/AuxiliaryProcess.cpp.orig
+++ Source/WebKit/Shared/AuxiliaryProcess.cpp
@@ -60,13 +60,7 @@ AuxiliaryProcess::~AuxiliaryProcess()
void AuxiliaryProcess::didClose(IPC::Connection&)
{
-// Stop the run loop for GTK and WPE to ensure a normal exit, since we need
-// atexit handlers to be called to cleanup resources like EGL displays.
-#if PLATFORM(GTK) || PLATFORM(WPE)
- stopRunLoop();
-#else
_exit(EXIT_SUCCESS);
-#endif
}
void AuxiliaryProcess::initialize(const AuxiliaryProcessInitializationParameters& parameters)

View File

@ -0,0 +1,40 @@
REVERT: https://github.com/WebKit/WebKit/commit/28d9d62aa2662266c2d9cb0032b036a257c6c8ab
This prevents a crash at exit time for any application using WebkitGTK.
From 28d9d62aa2662266c2d9cb0032b036a257c6c8ab Mon Sep 17 00:00:00 2001
From: Pablo Saavedra <psaavedra@igalia.com>
Date: Wed, 23 Feb 2022 09:32:13 +0000
Subject: [PATCH] [GTK][WPE] PlatformDisplay::terminateEglDisplays() is never called https://bugs.webkit.org/show_bug.cgi?id=217655
Index: Source/WebKit/WebProcess/WebProcess.cpp
--- Source/WebKit/WebProcess/WebProcess.cpp.orig
+++ Source/WebKit/WebProcess/WebProcess.cpp
@@ -257,7 +257,6 @@ namespace WebKit {
using namespace JSC;
using namespace WebCore;
-#if !PLATFORM(GTK) && !PLATFORM(WPE)
NO_RETURN static void callExit(IPC::Connection*)
{
#if OS(WINDOWS)
@@ -267,7 +266,6 @@ NO_RETURN static void callExit(IPC::Connection*)
_exit(EXIT_SUCCESS);
#endif
}
-#endif
WebProcess& WebProcess::singleton()
{
@@ -361,13 +359,9 @@ void WebProcess::initializeConnection(IPC::Connection*
{
AuxiliaryProcess::initializeConnection(connection);
-// Do not call exit in background queue for GTK and WPE because we need to ensure
-// atexit handlers are called in the main thread to cleanup resources like EGL displays.
-#if !PLATFORM(GTK) && !PLATFORM(WPE)
// We call _exit() directly from the background queue in case the main thread is unresponsive
// and AuxiliaryProcess::didClose() does not get called.
connection->setDidCloseOnConnectionWorkQueueCallback(callExit);
-#endif
#if !PLATFORM(GTK) && !PLATFORM(WPE) && !ENABLE(IPC_TESTING_API)
connection->setShouldExitOnSyncMessageSendFailure(true);

View File

@ -0,0 +1,19 @@
REVERT: https://github.com/WebKit/WebKit/commit/28d9d62aa2662266c2d9cb0032b036a257c6c8ab
This prevents a crash at exit time for any application using WebkitGTK.
From 28d9d62aa2662266c2d9cb0032b036a257c6c8ab Mon Sep 17 00:00:00 2001
From: Pablo Saavedra <psaavedra@igalia.com>
Date: Wed, 23 Feb 2022 09:32:13 +0000
Subject: [PATCH] [GTK][WPE] PlatformDisplay::terminateEglDisplays() is never called https://bugs.webkit.org/show_bug.cgi?id=217655
Index: Source/WebKit/WebProcess/WebProcess.h
--- Source/WebKit/WebProcess/WebProcess.h.orig
+++ Source/WebKit/WebProcess/WebProcess.h
@@ -511,7 +511,7 @@ class WebProcess : public AuxiliaryProcess (private)
bool shouldTerminate() override;
void terminate() override;
-#if USE(APPKIT) || PLATFORM(GTK) || PLATFORM(WPE)
+#if USE(APPKIT)
void stopRunLoop() override;
#endif

View File

@ -0,0 +1,31 @@
REVERT: https://github.com/WebKit/WebKit/commit/28d9d62aa2662266c2d9cb0032b036a257c6c8ab
This prevents a crash at exit time for any application using WebkitGTK.
From 28d9d62aa2662266c2d9cb0032b036a257c6c8ab Mon Sep 17 00:00:00 2001
From: Pablo Saavedra <psaavedra@igalia.com>
Date: Wed, 23 Feb 2022 09:32:13 +0000
Subject: [PATCH] [GTK][WPE] PlatformDisplay::terminateEglDisplays() is never called https://bugs.webkit.org/show_bug.cgi?id=217655
Index: Source/WebKit/WebProcess/glib/WebProcessGLib.cpp
--- Source/WebKit/WebProcess/glib/WebProcessGLib.cpp.orig
+++ Source/WebKit/WebProcess/glib/WebProcessGLib.cpp
@@ -73,20 +73,6 @@ namespace WebKit {
using namespace WebCore;
-void WebProcess::stopRunLoop()
-{
- // Pages are normally closed after Close message is received from the UI
- // process, but it can happen that the connection is closed before the
- // Close message is processed because the UI process close the socket
- // right after sending the Close message. Close here any pending page to
- // ensure the threaded compositor is invalidated and GL resources
- // released (see https://bugs.webkit.org/show_bug.cgi?id=217655).
- for (auto& webPage : copyToVector(m_pageMap.values()))
- webPage->close();
-
- AuxiliaryProcess::stopRunLoop();
-}
-
void WebProcess::platformSetCacheModel(CacheModel cacheModel)
{
WebCore::MemoryCache::singleton().setDisabled(cacheModel == CacheModel::DocumentViewer);