From: Dmitry Antipov <dmantipov@yandex.ru>
To: Paul Eggert <eggert@cs.ucla.edu>, Christoph <cschol2112@gmail.com>
Cc: 18403@debbugs.gnu.org
Subject: bug#18403: 24.4.50; emacsclient sometimes hangs on exit with Lucid GUI client
Date: Mon, 08 Sep 2014 12:45:46 +0400 [thread overview]
Message-ID: <540D6CBA.7090904@yandex.ru> (raw)
In-Reply-To: <540D18E0.4080205@cs.ucla.edu>
On 09/08/2014 06:48 AM, Paul Eggert wrote:
> Thanks, I can confirm that the attached patch (which reverts that change) does fix
> the bug on the trunk for me (trunk bzr 117838). Dmitry, do you have any thoughts?
Argh. It looks like we can't free XtDefaultFont, otherwise XtCloseDisplay causes
X protocol error, and poor handling of that causes a mess with normal fds listening
loop. Thanks.
While debugging this issue, I noticed one more error:
Breakpoint 1, die (msg=0x717274 "errno != EBADF || fd < 0", file=0x7170e0 "../../trunk/src/sysdep.c", line=2408)
at ../../trunk/src/alloc.c:7116
7116 fprintf (stderr, "\r\n%s:%d: Emacs fatal error: assertion failed: %s\r\n",
(gdb) bt 10
#0 0x00000000005f6cee in die (msg=0x717274 "errno != EBADF || fd < 0", file=0x7170e0 "../../trunk/src/sysdep.c", line=2408)
at ../../trunk/src/alloc.c:7116
#1 0x0000000000598469 in emacs_close (fd=8) at ../../trunk/src/sysdep.c:2408
#2 0x0000000000547834 in x_delete_terminal (terminal=0xfa0218) at ../../trunk/src/xterm.c:11381
#3 0x000000000051f8b6 in Fdelete_terminal (terminal=..., force=...) at ../../trunk/src/terminal.c:348
#4 0x00000000004290ba in delete_frame (frame=..., force=...) at ../../trunk/src/frame.c:1691
#5 0x0000000000429630 in Fdelete_frame (frame=..., force=...) at ../../trunk/src/frame.c:1801
#6 0x0000000000618c95 in Ffuncall (nargs=2, args=0x7fffd6a18ae0) at ../../trunk/src/eval.c:2815
#7 0x0000000000663e4a in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffd6a193a0)
at ../../trunk/src/bytecode.c:920
#8 0x00000000006194bd in funcall_lambda (fun=..., nargs=1, arg_vector=0x7fffd6a19398) at ../../trunk/src/eval.c:2980
#9 0x0000000000618e4e in Ffuncall (nargs=2, args=0x7fffd6a19390) at ../../trunk/src/eval.c:2861
#10 0x0000000000663e4a in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffd6a19c30)
at ../../trunk/src/bytecode.c:920
Steps to reproduce:
./src/emacs -Q --daemon
./lib-src/emacsclient -c
gdb -p [pid of daemon process]
b die
c
C-x C-x in client window
==> backtrace above
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:
eassert (errno != EBADF || fd < 0);
Since daemon runs in background, there is no way to see this error except using debugger.
Also note that the comment above emacs_close says do not use this function for non-negative
but closed descriptor.
Dmitry
next prev parent reply other threads:[~2014-09-08 8:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 3:05 bug#18403: 24.4.50; emacsclient sometimes hangs on exit with Lucid GUI client Christoph Scholtes
2014-09-07 7:25 ` Paul Eggert
2014-09-08 1:36 ` Christoph
2014-09-08 1:40 ` Christoph
2014-09-08 2:48 ` Paul Eggert
2014-09-08 8:45 ` Dmitry Antipov [this message]
2014-09-08 13:44 ` Paul Eggert
2014-09-08 14:18 ` Dmitry Antipov
2014-09-08 21:33 ` Christoph
2014-09-13 16:21 ` Christoph
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540D6CBA.7090904@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=18403@debbugs.gnu.org \
--cc=cschol2112@gmail.com \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.