Stephen J. Turnbull wrote:
Ron Isaacson writes:
> This is a bit of a weird one... when using XEmacs 21.5 inside
> screen(1), and using multiple frames, XEmacs sometimes goes bonkers
> when I resize the terminal window.
Replicated in a Mac OS X Terminal over ssh with 21.5.28.
I did manage to get the values of (frame-height) and (frame-width),
and they are in fact 2 and 3 respectively. Evidently something is
going wrong with communication of the terminal dimensions.
Ok, I was able to reproduce this under gdb. I tracked down where the
problem happens, although I don't really understand why. See
end_hold_frame_size_changes in redisplay.c, which says:
if (f->size_change_pending)
change_frame_size (f, f->new_height, f->new_width, 0);
So when it exits a period when no frame size changes were allowed, it
checks to see if there's one queued, and executes it if so. Sounds
reasonable enough, except that I've got this stack trace:
#0 change_frame_size (f=0x968a758, newheight=0, newwidth=0, delay=0)
at frame.c:3433
#1 0x0818b577 in end_hold_frame_size_changes (unused_obj=136941128)
at redisplay.c:6725
#2 0x080ccc81 in unbind_to_hairy (count=3) at eval.c:6113
#3 0x080ccbc5 in unbind_to_1 (count=3, value=136941128) at eval.c:6065
#4 0x0818b6ce in exit_redisplay_critical_section (depth=3) at redisplay.c:6784
#5 0x0818bc55 in redisplay_frame (f=0x96c8a68, preemption_check=1)
at redisplay.c:6975
#6 0x0818bf0a in redisplay_device (d=0x967a290, automatic=1)
at redisplay.c:7028
#7 0x0818c512 in redisplay_without_hooks () at redisplay.c:7103
#8 0x0818c7bb in redisplay_no_pre_idle_hook () at redisplay.c:7174
#9 0x0818c76f in redisplay () at redisplay.c:7156
#10 0x080d9381 in Fnext_event (event=157446364, prompt=136941128)
at event-stream.c:2288
Note that newheight and newwidth in the call to change_frame_size are
both 0. Here's how I got there:
After a resize, I see TWO calls to change_frame_size with the correct
dimensions, while delay == 1. Each of these sets the f->new_*
variables, along with size_change_pending, then returns. Then there's
a THIRD call, again with correct dimensions, when delay == 0; that
sets size_change_pending to 0 and then we go through a full redisplay.
redisplay_frame does:
depth = enter_redisplay_critical_section ();
and gets back a depth of 3. It proceeds all the way through the
CRITICAL REDISPLAY SECTION, then when it's done, calls:
exit_redisplay_critical_section (depth);
Now, I confirmed that just before that call, f->size_change_pending is
still 0. However, when exit_redisplay_critical_section does its
unbind_to business, specpdl_depth_counter starts at 13; by the time it
walks down to 3, f->size_change_pending has been reset to 1, but the
two f->new_* variables are still 0. This is what leads to the stack
trace shown above. The 2x3 dimensions are imposed by check_frame_size,
which won't let you create a 0x0 frame.
That's about as far as I've been able to get. The problem seems to be
introduced somewhere in the unwind chain created by
begin_redisplay_critical_section, but there's some serious black magic
in there.
Any suggestions on where to go from here?
--
Ron Isaacson
Morgan Stanley
ron.isaacson(a)morganstanley.com / (212) 276-1144
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta