Title: [210173] releases/WebKitGTK/webkit-2.14/Source/WebKit2
Revision
210173
Author
[email protected]
Date
2016-12-27 08:43:39 -0800 (Tue, 27 Dec 2016)

Log Message

Merge r208285 - [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
https://bugs.webkit.org/show_bug.cgi?id=164303

Reviewed by Michael Catanzaro.

This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.

* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
(WebKit::AcceleratedBackingStoreX11::update):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog (210172 => 210173)


--- releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog	2016-12-27 16:41:46 UTC (rev 210172)
+++ releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog	2016-12-27 16:43:39 UTC (rev 210173)
@@ -1,3 +1,17 @@
+2016-11-02  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
+        https://bugs.webkit.org/show_bug.cgi?id=164303
+
+        Reviewed by Michael Catanzaro.
+
+        This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
+        BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
+
+        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
+        (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
+        (WebKit::AcceleratedBackingStoreX11::update):
+
 2016-11-29  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Database process should not initialize gtk

Modified: releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp (210172 => 210173)


--- releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp	2016-12-27 16:41:46 UTC (rev 210172)
+++ releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp	2016-12-27 16:43:39 UTC (rev 210173)
@@ -33,6 +33,7 @@
 #include "WebPageProxy.h"
 #include <WebCore/CairoUtilities.h>
 #include <WebCore/PlatformDisplayX11.h>
+#include <WebCore/XErrorTrapper.h>
 #include <X11/Xlib.h>
 #include <X11/extensions/Xdamage.h>
 #include <cairo-xlib.h>
@@ -116,10 +117,15 @@
 
 AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11()
 {
+    if (!m_surface && !m_damage)
+        return;
+
+    Display* display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native();
+    XErrorTrapper trapper(display, XErrorTrapper::Policy::Crash, { BadDrawable, BadDamage });
     if (m_damage) {
         XDamageNotifier::singleton().remove(m_damage.get());
         m_damage.reset();
-        XSync(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), False);
+        XSync(display, False);
     }
 }
 
@@ -132,6 +138,7 @@
     Display* display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native();
 
     if (m_surface) {
+        XErrorTrapper trapper(display, XErrorTrapper::Policy::Crash, { BadDrawable, BadDamage });
         if (m_damage) {
             XDamageNotifier::singleton().remove(m_damage.get());
             m_damage.reset();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to