Skip to content
Permalink
Browse files
[GTK] BadDamage X Window System error in WebKit::AcceleratedBackingSt…
…oreX11::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):

Canonical link: https://commits.webkit.org/182044@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Nov 2, 2016
1 parent 03c125f commit bea55bee70ea940faf2a5d2ad0aa5e953e549cf7
Showing with 22 additions and 1 deletion.
  1. +14 −0 Source/WebKit2/ChangeLog
  2. +8 −1 Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
@@ -1,3 +1,17 @@
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>

[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-02 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
@@ -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(WebPageProxy& webPage)

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 @@ void AcceleratedBackingStoreX11::update(const LayerTreeContext& layerTreeContext
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();

0 comments on commit bea55be

Please sign in to comment.