Subject: emacs --daemon stuck in infinite loop

From: Dan Nicolaescu <[email-masked]>
Date: Mon, 05 Aug 2013 08:36:11 -0400

This seems to be reproducible. 

emacs compiled with Lucid toolkit

The recipe here uses Xnest because it easy to kill/restart, probably the same
happens if the X session is killed.

Xnest :1&
xterm -display :1&

Now type in the xterm above:
emacs --daemon

In a different xterm type:
emacsclient -t Makefile 
(or any file that exists).
C-z

now while emacsclient is suspended kill Xnest (using the window manager
close button)

Emacs daemon should still survive, but 
emacsclient -t 
cannot connect to it. 

Looking in the debugger, emacs is stuck in an infinite loop in: 

frame.c: next_frame

while (passed < 2)

passed never gets set to more than 1, so the loop never ends.

What is the intention of that code?