Commit 46eadc7a authored by Chong Yidong's avatar Chong Yidong

Print informative error message when aborting on GTK disconnect.

* xterm.c (x_connection_closed): Print informative error message
when aborting on GTK.  This requires using shut_down_emacs
directly instead of Fkill_emacs.
parent e084bc3d
2010-10-31 Chong Yidong <cyd@stupidchicken.com>
* xterm.c (x_connection_closed): Print informative error message
when aborting on GTK. This requires using shut_down_emacs
directly instead of Fkill_emacs.
2010-10-25 Michael Albinus <michael.albinus@gmx.de> 2010-10-25 Michael Albinus <michael.albinus@gmx.de>
* dbusbind.c (Fdbus_call_method_asynchronously) * dbusbind.c (Fdbus_call_method_asynchronously)
......
...@@ -7882,48 +7882,44 @@ x_connection_closed (dpy, error_message) ...@@ -7882,48 +7882,44 @@ x_connection_closed (dpy, error_message)
delete_frame (frame, Qnoelisp); delete_frame (frame, Qnoelisp);
} }
/* We have to close the display to inform Xt that it doesn't /* If DPYINFO is null, this means we didn't open the display in the
exist anymore. If we don't, Xt will continue to wait for first place, so don't try to close it. */
events from the display. As a consequence, a sequence of
M-x make-frame-on-display RET :1 RET
...kill the new frame, so that we get an IO error...
M-x make-frame-on-display RET :1 RET
will indefinitely wait in Xt for events for display `:1', opened
in the first call to make-frame-on-display.
Closing the display is reported to lead to a bus error on
OpenWindows in certain situations. I suspect that is a bug
in OpenWindows. I don't know how to circumvent it here. */
if (dpyinfo) if (dpyinfo)
{ {
#ifdef USE_X_TOOLKIT #ifdef USE_X_TOOLKIT
/* If DPYINFO is null, this means we didn't open the display /* We have to close the display to inform Xt that it doesn't
in the first place, so don't try to close it. */ exist anymore. If we don't, Xt will continue to wait for
{ events from the display. As a consequence, a sequence of
extern void (*fatal_error_signal_hook) P_ ((void));
fatal_error_signal_hook = x_fatal_error_signal; M-x make-frame-on-display RET :1 RET
XtCloseDisplay (dpy); ...kill the new frame, so that we get an IO error...
fatal_error_signal_hook = NULL; M-x make-frame-on-display RET :1 RET
}
#endif will indefinitely wait in Xt for events for display `:1',
opened in the first call to make-frame-on-display.
Closing the display is reported to lead to a bus error on
OpenWindows in certain situations. I suspect that is a bug
in OpenWindows. I don't know how to circumvent it here. */
extern void (*fatal_error_signal_hook) P_ ((void));
fatal_error_signal_hook = x_fatal_error_signal;
XtCloseDisplay (dpy);
fatal_error_signal_hook = NULL;
#endif /* USE_X_TOOLKIT */
#ifdef USE_GTK #ifdef USE_GTK
/* There is a long-standing bug in GTK that prevents the GTK /* A long-standing GTK bug prevents proper disconnect handling
main loop from recovering gracefully from disconnects (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once,
(https://bugzilla.gnome.org/show_bug.cgi?id=85715). Among the resulting Glib error message loop filled a user's disk.
other problems, this gives rise to a stream of Glib error To avoid this, kill Emacs unconditionally on disconnect. */
messages that, in one incident, filled up a user's hard disk shut_down_emacs (0, 0, Qnil);
(http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00927.html). fprintf (stderr, "%s\n\
So, kill Emacs unconditionally if the display is closed. */ When compiled with GTK, Emacs cannot recover from X disconnects.\n\
{ This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\
fprintf (stderr, "%s\n", error_msg); For details, see etc/PROBLEMS.\n",
Fkill_emacs (make_number (70)); error_msg);
abort (); /* NOTREACHED */ abort ();
} #endif /* USE_GTK */
#endif
/* Indicate that this display is dead. */ /* Indicate that this display is dead. */
dpyinfo->display = 0; dpyinfo->display = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment