Subject: Re: bug#18112: 24.4.50; emacs --daemon infinite loop in find_interval

From: Eli Zaretskii <[email-masked]>
Date: Sat, 26 Jul 2014 12:33:30 +0300

> Date: Sat, 26 Jul 2014 12:04:47 +0300
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > Date: Sat, 26 Jul 2014 10:55:11 +0300
> > From: Eli Zaretskii <[email-masked]>
> > Cc: [email-masked]
> > 
> > The loop is in redisplay, and the reason seems to be that get_tty_size
> > returns incorrect size after the second tmux pane is closed with ^D.
> > We get one line more than tmux leaves us (after usurping 1 line for
> > its status line).
> 
> Actually, I think I was wrong (I forgot to count the line used for the
> menu bar).  So the reason is probably elsewhere...

Ok, my original analysis was based on a mistake.  Moreover, tmux is
not really related to the problem at all, and neither is "C-x 3".

Here's a simpler way to reproduce the problem:

Open a terminal emulator (e.g., xterm) window, and in that window:

  emacs -Q --daemon
  emacsclient -t

Now open another terminal emulator window, and make it have a smaller
size.  Then, in that window:

  emacsclient -t
  C-x C-c

Now go back to the first xterm window and resize it (e.g., with a
mouse).  Emacs is now stuck in an infloop.

So the important players here are (1) a frame on another tty that has
a different size, and (2) resizing the frame after deleting another
frame on a different tty.