21.5
For some reason, when using the Quartz window manager to close an
XEmacs frame (close button or Cmd-W) on Mac OS X "Mavericks",
x_IO_error_handler gets invoked, with ENOERR as the current system
errno. This causes the frame's device to get deleted, which kills
XEmacs if there are no other frames open.
I suspect this is brain damage at Apple. I've checked several bug
trackers but seen nothing like this.
I've run with the following patch on Mavericks for a while, and also
on Gentoo (but I don't use X on that machine much and tend to close
frames with C-x 5 0 when I do -- still it's guaranteed crash on Mac,
so Linux is probably OK).
If somebody thinks I should conditionalize on Mac, I can do that, but
since X11 uses system errors here, testing against ENOERR should DTRT
on all platforms.
Will commit after a couple days if there is no objection.
Note: it's possible this function should be refactored but it is an
error handler so I'll leave that for another day. Also, on affected
platforms it will generate an annoying error message. Suppressing
that can wait for another day, too.
Steve
diff -r be3ca9e58c92 src/ChangeLog
--- a/src/ChangeLog Thu Jun 19 12:06:33 2014 +0900
+++ b/src/ChangeLog Thu Jun 19 15:27:47 2014 +0900
@@ -1,3 +1,18 @@
+2014-06-19 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * device-x.c (x_IO_error_handler): Check errno for a real error.
+
+ On Mac OS X 10.9 "Mavericks", x_IO_error_handler gets triggered by
+ Cmd-W or clicking on the WM's close button:
+
+ xemacs: Fatal I/O Error 0 (Undefined error: 0) on display connection \
+ "/tmp/launch-HpN0rX/org.macosforge.xquartz:0.0"
+ after 3746329 requests (3746329 known processed) \
+ with 0 events remaining.
+
+ This is inappropriate because there are other frames open on the
+ device.
+
2014-06-19 Stephen J. Turnbull <stephen(a)xemacs.org>
* buffer.c (case_fold_search): Improve docstring.
diff -r be3ca9e58c92 src/device-x.c
--- a/src/device-x.c Thu Jun 19 12:06:33 2014 +0900
+++ b/src/device-x.c Thu Jun 19 15:27:47 2014 +0900
@@ -1211,7 +1211,9 @@
assert (d != NULL);
dev = wrap_device (d);
- if (NILP (find_nonminibuffer_frame_not_on_device (dev)))
+ /* The test against ENOERR is a hack for Mac OS X 10.9, which invokes this
+ handler on successful deletion of a window. */
+ if (errno != ENOERR && NILP (find_nonminibuffer_frame_not_on_device (dev)))
{
int depth = begin_dont_check_for_quit ();
/* We're going down. */
@@ -1246,8 +1248,10 @@
/* According to X specs, we should not return from this function, or
Xlib might just decide to exit(). So we mark the offending
- console for deletion and throw to top level. */
- if (d)
+ console for deletion and throw to top level.
+ The test against ENOERR is a hack for Mac OS X 10.9, which invokes this
+ handler on successful deletion of a window. */
+ if (errno != ENOERR && d)
{
enqueue_magic_eval_event (io_error_delete_device, dev);
DEVICE_X_BEING_DELETED (d) = 1;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches