WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
wkgtk4-xvfb-crashes.diff (text/plain), 7.50 KB, created by
Carlos Garcia Campos
on 2021-03-12 05:54:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2021-03-12 05:54:22 PST
Size:
7.50 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index efd07449cd20..26bde3ea0846 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,14 @@ >+2021-03-12 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK] GTK4 crashes with XVFB: GLXBadWindow >+ https://bugs.webkit.org/show_bug.cgi?id=223108 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/graphics/x11/PlatformDisplayX11.cpp: >+ (WebCore::PlatformDisplayX11::supportsGLX const): Check if GLX extension is supported and return the base error code. >+ * platform/graphics/x11/PlatformDisplayX11.h: >+ > 2021-03-11 Antoine Quint <graouts@webkit.org> > > Fix interpolation of perspective property >diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >index 4b5566efd282..88e8412e009a 100644 >--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >@@ -42,6 +42,10 @@ > #include <EGL/eglext.h> > #endif > >+#if USE(GLX) >+#include <GL/glx.h> >+#endif >+ > #if USE(LCMS) > #include <lcms2.h> > #endif >@@ -130,6 +134,26 @@ bool PlatformDisplayX11::supportsXDamage(Optional<int>& damageEventBase, Optiona > return m_supportsXDamage.value(); > } > >+bool PlatformDisplayX11::supportsGLX(Optional<int>& glxErrorBase) const >+{ >+#if USE(GLX) >+ if (!m_supportsGLX) { >+ m_supportsXDamage = false; >+ if (m_display) { >+ int eventBase, errorBase; >+ m_supportsGLX = glXQueryExtension(m_display, &eventBase, &errorBase); >+ if (m_supportsXDamage.value()) >+ m_glxErrorBase = errorBase; >+ } >+ } >+ >+ glxErrorBase = m_glxErrorBase; >+ return m_supportsGLX.value(); >+#else >+ return false; >+#endif >+} >+ > void* PlatformDisplayX11::visual() const > { > if (m_visual) >diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >index 4ed2f9e3723a..b4255b106c56 100644 >--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >@@ -49,6 +49,7 @@ public: > void* visual() const; > bool supportsXComposite() const; > bool supportsXDamage(Optional<int>& damageEventBase, Optional<int>& damageErrorBase) const; >+ bool supportsGLX(Optional<int>& glxErrorBase) const; > > private: > PlatformDisplayX11(::Display*, NativeDisplayOwned); >@@ -68,6 +69,10 @@ private: > mutable Optional<bool> m_supportsXDamage; > mutable Optional<int> m_damageEventBase; > mutable Optional<int> m_damageErrorBase; >+#if USE(GLX) >+ mutable Optional<bool> m_supportsGLX; >+ mutable Optional<int> m_glxErrorBase; >+#endif > mutable void* m_visual { nullptr }; > }; > >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 493092cf8e3f..a3aeaa86c26b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2021-03-12 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK] GTK4 crashes with XVFB: GLXBadWindow >+ https://bugs.webkit.org/show_bug.cgi?id=223108 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Handle GLXBadWindow errors in AcceleratedBackingStoreX11. >+ >+ * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: >+ (WebKit::AcceleratedBackingStoreX11::checkRequirements): >+ (WebKit::glxErrorCode): >+ (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): >+ (WebKit::AcceleratedBackingStoreX11::update): >+ > 2021-03-12 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Bump API version when building with libsoup3 >diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >index 9710bf951180..60ba0726cdf5 100644 >--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >@@ -46,10 +46,18 @@ > #include <wtf/HashMap.h> > #include <wtf/NeverDestroyed.h> > >+#if USE(GLX) >+#include <X11/Xproto.h> >+#include <GL/glxproto.h> >+#endif >+ > namespace WebKit { > > static Optional<int> s_damageEventBase; > static Optional<int> s_damageErrorBase; >+#if USE(GLX) >+static Optional<int> s_glxErrorBase; >+#endif > > class XDamageNotifier { > WTF_MAKE_NONCOPYABLE(XDamageNotifier); >@@ -135,6 +143,10 @@ private: > bool AcceleratedBackingStoreX11::checkRequirements() > { > auto& display = downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()); >+#if USE(GLX) >+ // GLX is optional, he we just want the error base. >+ display.supportsGLX(s_glxErrorBase); >+#endif > return display.supportsXComposite() && display.supportsXDamage(s_damageEventBase, s_damageErrorBase); > } > >@@ -155,13 +167,26 @@ static inline unsigned char xDamageErrorCode(unsigned char errorCode) > return static_cast<unsigned>(s_damageErrorBase.value()) + errorCode; > } > >+#if USE(GLX) >+static inline unsigned char glxErrorCode(unsigned char errorCode) >+{ >+ ASSERT(s_glxErrorBase); >+ return static_cast<unsigned>(s_glxErrorBase.value()) + errorCode; >+} >+#endif >+ > AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11() > { > if (!m_surface && !m_damage) > return; > > Display* display = downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native(); >- WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) }); >+ Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) }; >+#if USE(GLX) >+ if (s_glxErrorBase) >+ errorList.append(glxErrorCode(GLXBadWindow)); >+#endif >+ WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList)); > if (m_damage) { > XDamageNotifier::singleton().remove(m_damage.get()); > m_damage.reset(); >@@ -178,7 +203,12 @@ void AcceleratedBackingStoreX11::update(const LayerTreeContext& layerTreeContext > Display* display = downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native(); > > if (m_surface) { >- WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) }); >+ Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) }; >+#if USE(GLX) >+ if (s_glxErrorBase) >+ errorList.append(glxErrorCode(GLXBadWindow)); >+#endif >+ WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList)); > if (m_damage) { > XDamageNotifier::singleton().remove(m_damage.get()); > m_damage.reset(); >@@ -198,7 +228,12 @@ void AcceleratedBackingStoreX11::update(const LayerTreeContext& layerTreeContext > float deviceScaleFactor = m_webPage.deviceScaleFactor(); > size.scale(deviceScaleFactor); > >- WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) }); >+ Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) }; >+#if USE(GLX) >+ if (s_glxErrorBase) >+ errorList.append(glxErrorCode(GLXBadWindow)); >+#endif >+ WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList)); > ASSERT(downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native() == gdk_x11_display_get_xdisplay(gdk_display_get_default())); > #if USE(GTK4) > auto* visual = WK_XVISUAL(downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 223108
:
423038
|
423040
|
423044