Subject: Re: bug#18403: 24.4.50; emacsclient sometimes hangs on exit with Lucid GUI client

From: Paul Eggert <[email-masked]>
Date: Mon, 08 Sep 2014 06:44:47 -0700

Dmitry Antipov wrote:
> IIUC dpyinfo->connection is no longer valid after call to
> X(t)CloseDisplay (dpyinfo->display).
> But this fd is still > 0, so we hit eassert at sysdep.c:2408:

I cannot reproduce this new problem on Ubuntu 14.04, configuring trunk 
bzr 117843 --with-x-toolkit=lucid.  x_delete_terminal calls 
XtCloseDisplay, and then calls emacs_close (dpyinfo->connection), and 
the 'close' returns 0.

Perhaps you configured with some other toolkit?  That might explain the 
discrepancy.

Does it fix things for you if you add a line 'dpyinfo->connection = -1;' 
after the existing line 'dpyinfo->display = 0;' in xterm.c's 
x_connection_closed?  Though that might cause a file descriptor leak; 
I'm not fully following what's going on here, since I can't reproduce 
the new problem.