Added fix for 'ABORT: X_ShmAttach: BadAccess' crashes (mozbz#1271100)

This commit is contained in:
Martin Stransky 2016-11-30 22:02:53 +01:00
parent 0578c15a46
commit 5f619866d5
2 changed files with 45 additions and 2 deletions

View File

@ -94,7 +94,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 50.0.2
Release: 1%{?pre_tag}%{?dist}
Release: 2%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
@ -139,6 +139,7 @@ Patch406: mozilla-256180.patch
# Rebase Gtk3 widget code to latest trunk to
# fix various rendering problems
Patch407: widget-rebase.patch
Patch408: mozilla-1271100.patch
# Debian patches
Patch500: mozilla-440908.patch
@ -284,6 +285,7 @@ cd %{tarballdir}
# Rebase Gtk3 widget code to latest trunk to
# fix various rendering problems
%patch407 -p1 -b .widget-rebase
%patch408 -p1 -b .1271100
# Debian extension patch
%patch500 -p1 -b .440908
@ -792,7 +794,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Mon Nov 30 2016 Martin Stransky <stransky@redhat.com> - 50.0.2-1
* Wed Nov 30 2016 Martin Stransky <stransky@redhat.com> - 50.0.2-2
- Added fix for "ABORT: X_ShmAttach: BadAccess" crashes
(mozbz#1271100)
* Wed Nov 30 2016 Martin Stransky <stransky@redhat.com> - 50.0.2-1
- Update to latest upstream (50.0.2)
* Mon Nov 28 2016 Martin Stransky <stransky@redhat.com> - 50.0.1-1

37
mozilla-1271100.patch Normal file
View File

@ -0,0 +1,37 @@
# HG changeset patch
# User Lee Salzman <lsalzman@mozilla.com>
# Date 1480470918 18000
# Tue Nov 29 20:55:18 2016 -0500
# Node ID ffc92a98adee4c3ebb1f3b8c593e913a74ef6a4a
# Parent 8d8846f63b74eb930e48b410730ae088e9bdbee8
work around race in system Cairo's XShm usage
MozReview-Commit-ID: VGee6ungCz
diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
--- a/widget/gtk/mozgtk/mozgtk.c
+++ b/widget/gtk/mozgtk/mozgtk.c
@@ -606,8 +606,23 @@ STUB(gdk_window_set_back_pixmap)
STUB(gdk_x11_colormap_foreign_new)
STUB(gdk_x11_colormap_get_xcolormap)
STUB(gdk_x11_drawable_get_xdisplay)
STUB(gdk_x11_drawable_get_xid)
STUB(gdk_x11_window_get_drawable_impl)
STUB(gdkx_visual_get)
STUB(gtk_object_get_type)
#endif
+
+#include <X11/Xlib.h>
+// Bug 1271100
+// We need to trick system Cairo into not using the XShm extension due to
+// a race condition in it that results in frequent BadAccess errors. Cairo
+// relies upon XShmQueryExtension to initially detect if XShm is available.
+// So we define our own stub that always indicates XShm not being present.
+// mozgtk loads before libXext/libcairo and so this stub will take priority.
+// Our tree usage goes through xcb and remains unaffected by this.
+MOZ_EXPORT Bool
+XShmQueryExtension(Display* aDisplay)
+{
+ return False;
+}
+