From f3307b88b09c23aa41ca114eb5e4fdbb569aa046 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Feb 05 2018 10:41:04 +0000 Subject: Do not generate a core on Wayland socket issues Exit without a FatalError() on Wayland socket errors to avoid issues being filed against Xwayland for all Wayland compositor issues. --- diff --git a/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch new file mode 100644 index 0000000..5f2efe8 --- /dev/null +++ b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch @@ -0,0 +1,99 @@ +From fe46cbea0f19959d469ca4d1f09be379dc7b1e45 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 21 Nov 2017 14:45:13 +0100 +Subject: [PATCH xserver] =?UTF-8?q?xwayland:=20Give=20up=20=E2=80=9Ccleanl?= + =?UTF-8?q?y=E2=80=9C=20on=20Wayland=20socket=20errors?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Xwayland is a pretty standard Wayland client, we want to be able to +capture core dumps on crashes. + +Yet using "-core" causes any FatalError() to generate a core dump, +meaning that we would get a core file for all Wayland server crashes, +which would generate a lot of false positives. + +Instead of using FatalError() on Wayland socket errors, give up cleanly +to avoid dumping core files when "-core" is used. + +See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502 + and: https://bugzilla.gnome.org/show_bug.cgi?id=789086 + +Reviewed-by: Adam Jackson +Signed-off-by: Olivier Fourdan +--- + hw/xwayland/xwayland.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 638022180..c5a3ae7ae 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -73,6 +73,22 @@ ddxBeforeReset(void) + } + #endif + ++ _X_NORETURN ++static void _X_ATTRIBUTE_PRINTF(1, 2) ++xwl_give_up(const char *f, ...) ++{ ++ va_list args; ++ ++ va_start(args, f); ++ VErrorFSigSafe(f, args); ++ va_end(args); ++ ++ CloseWellKnownConnections(); ++ OsCleanup(TRUE); ++ fflush(stderr); ++ exit(1); ++} ++ + void + ddxUseMsg(void) + { +@@ -719,13 +735,13 @@ xwl_read_events (struct xwl_screen *xwl_screen) + + ret = wl_display_read_events(xwl_screen->display); + if (ret == -1) +- FatalError("failed to read Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to read Wayland events: %s\n", strerror(errno)); + + xwl_screen->prepare_read = 0; + + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); + } + + static int +@@ -752,7 +768,7 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + wl_display_prepare_read(xwl_screen->display) == -1) { + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", ++ xwl_give_up("failed to dispatch Wayland events: %s\n", + strerror(errno)); + } + +@@ -761,13 +777,13 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + pollout: + ready = xwl_display_pollout(xwl_screen, 5); + if (ready == -1 && errno != EINTR) +- FatalError("error polling on XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("error polling on XWayland fd: %s\n", strerror(errno)); + + if (ready > 0) + ret = wl_display_flush(xwl_screen->display); + + if (ret == -1 && errno != EAGAIN) +- FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("failed to write to XWayland fd: %s\n", strerror(errno)); + + xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); + } +-- +2.14.3 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index eadbfa8..d58ea4a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.19.6 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -105,6 +105,9 @@ Patch9910: 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch Patch9911: 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch +# Upstream commit fe46cbe for Xwayland - Not in server-1.19-branch +Patch9950: 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch + # From Debian use intel ddx driver only for gen4 and older chipsets %if 0%{?fedora} > 25 || 0%{?rhel} > 7 Patch20: 06_use-intel-only-on-pre-gen4.diff @@ -621,6 +624,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Tue Jan 30 2018 Olivier Fourdan 1.19.6-3 +- Avoid generating a core file when the Wayland compositor is gone. + * Thu Jan 11 2018 Peter Hutterer 1.19.6-2 - Fix handling of devices with ID_INPUT=null