Fix xorg sometimes crashing on machine poweroff/shutdown (#1269210)
This commit is contained in:
parent
fc966ac646
commit
945546e6f0
@ -0,0 +1,84 @@
|
|||||||
|
From ca355e9d6acab994453cdbb65cb213d09ee4a50f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
Date: Wed, 14 Oct 2015 15:10:35 +0200
|
||||||
|
Subject: [PATCH] linux: Do not call FatalError from xf86CloseConsole
|
||||||
|
|
||||||
|
FatalError ends up calling xf86CloseConsole itself, so calling FatalError
|
||||||
|
from within xf86CloseConsole is not a good idea.
|
||||||
|
|
||||||
|
All the other error checking done in xf86CloseConsole uses
|
||||||
|
xf86Msg(X_WARNING, ...) except for the switch_to() helper function,
|
||||||
|
change things so that switch_to() also uses xf86Msg rather then FatalError
|
||||||
|
when called from xf86CloseConsole.
|
||||||
|
|
||||||
|
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210
|
||||||
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
---
|
||||||
|
hw/xfree86/os-support/linux/lnx_init.c | 24 ++++++++++++++++--------
|
||||||
|
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
|
||||||
|
index ec06a05..9fec964 100644
|
||||||
|
--- a/hw/xfree86/os-support/linux/lnx_init.c
|
||||||
|
+++ b/hw/xfree86/os-support/linux/lnx_init.c
|
||||||
|
@@ -64,17 +64,25 @@ drain_console(int fd, void *closure)
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
-switch_to(int vt, const char *from)
|
||||||
|
+switch_to(int vt, Bool is_open)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt));
|
||||||
|
- if (ret < 0)
|
||||||
|
- FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ if (is_open)
|
||||||
|
+ FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", strerror(errno));
|
||||||
|
+ else
|
||||||
|
+ xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n", strerror(errno));
|
||||||
|
+ }
|
||||||
|
|
||||||
|
SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt));
|
||||||
|
- if (ret < 0)
|
||||||
|
- FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ if (is_open)
|
||||||
|
+ FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n", strerror(errno));
|
||||||
|
+ else
|
||||||
|
+ xf86Msg(X_WARNING, "xf86CloseConsole: VT_WAITACTIVE failed: %s\n", strerror(errno));
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
@@ -233,7 +241,7 @@ xf86OpenConsole(void)
|
||||||
|
/*
|
||||||
|
* now get the VT. This _must_ succeed, or else fail completely.
|
||||||
|
*/
|
||||||
|
- switch_to(xf86Info.vtno, "xf86OpenConsole");
|
||||||
|
+ switch_to(xf86Info.vtno, TRUE);
|
||||||
|
|
||||||
|
SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
|
||||||
|
if (ret < 0)
|
||||||
|
@@ -294,7 +302,7 @@ xf86OpenConsole(void)
|
||||||
|
else { /* serverGeneration != 1 */
|
||||||
|
if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) {
|
||||||
|
/* now get the VT */
|
||||||
|
- switch_to(xf86Info.vtno, "xf86OpenConsole");
|
||||||
|
+ switch_to(xf86Info.vtno, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -346,7 +354,7 @@ xf86CloseConsole(void)
|
||||||
|
* Perform a switch back to the active VT when we were started
|
||||||
|
*/
|
||||||
|
if (activeVT >= 0) {
|
||||||
|
- switch_to(activeVT, "xf86CloseConsole");
|
||||||
|
+ switch_to(activeVT, FALSE);
|
||||||
|
activeVT = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.5.0
|
||||||
|
|
@ -45,7 +45,7 @@
|
|||||||
Summary: X.Org X11 X server
|
Summary: X.Org X11 X server
|
||||||
Name: xorg-x11-server
|
Name: xorg-x11-server
|
||||||
Version: 1.18.0
|
Version: 1.18.0
|
||||||
Release: 0.4%{?gitdate:.%{gitdate}}%{dist}
|
Release: 0.5%{?gitdate:.%{gitdate}}%{dist}
|
||||||
URL: http://www.x.org
|
URL: http://www.x.org
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: User Interface/X
|
Group: User Interface/X
|
||||||
@ -98,6 +98,10 @@ Patch9100: exa-only-draw-valid-trapezoids.patch
|
|||||||
# http://lists.x.org/archives/xorg-devel/2015-September/047304.html
|
# http://lists.x.org/archives/xorg-devel/2015-September/047304.html
|
||||||
Patch9200: 0001-present-Don-t-stash-the-MSC-value-when-present_get_u.patch
|
Patch9200: 0001-present-Don-t-stash-the-MSC-value-when-present_get_u.patch
|
||||||
|
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1269210
|
||||||
|
# http://lists.x.org/archives/xorg-devel/2015-October/047558.html
|
||||||
|
Patch9300: 0001-linux-Do-not-call-FatalError-from-xf86CloseConsole.patch
|
||||||
|
|
||||||
# because the display-managers are not ready yet, do not upstream
|
# because the display-managers are not ready yet, do not upstream
|
||||||
Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
||||||
|
|
||||||
@ -637,6 +641,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Oct 14 2015 Hans de Goede <hdegoede@redhat.com> - 1.18.0-0.5
|
||||||
|
- Fix xorg sometimes crashing on machine poweroff/shutdown (#1269210)
|
||||||
|
|
||||||
* Thu Sep 24 2015 Rex Dieter <rdieter@fedoraproject.org> 1.18.0-0.4
|
* Thu Sep 24 2015 Rex Dieter <rdieter@fedoraproject.org> 1.18.0-0.4
|
||||||
- pull in candidate fix for clients getting stuck waiting indefinitely
|
- pull in candidate fix for clients getting stuck waiting indefinitely
|
||||||
for an idle event when a CRTC is turned off (#1256082,#1258084)
|
for an idle event when a CRTC is turned off (#1256082,#1258084)
|
||||||
|
Loading…
Reference in New Issue
Block a user