From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#15025: emacs --daemon stuck in infinite loop Date: Tue, 13 Aug 2013 10:41:20 -0400 Message-ID: References: <4jpptql6gy.fsf@fencepost.gnu.org> <5201AD43.4040105@yandex.ru> <52045526.8060404@yandex.ru> <5204B28B.2060505@gmx.at> <5205040B.5050404@yandex.ru> <5205526D.7040408@gmx.at> <5208985B.9010106@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1376404931 23137 80.91.229.3 (13 Aug 2013 14:42:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Aug 2013 14:42:11 +0000 (UTC) Cc: Paul Eggert , 15025@debbugs.gnu.org To: Dmitry Antipov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 13 16:42:13 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V9FnY-0007A8-OM for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2013 16:42:12 +0200 Original-Received: from localhost ([::1]:56422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9FnY-00025S-5y for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2013 10:42:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9FnS-00025A-9D for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 10:42:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9FnP-0008Fb-6y for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 10:42:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9FnP-0008FK-3i for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 10:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V9FnO-0005d9-Gh for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dan Nicolaescu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2013 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15025-submit@debbugs.gnu.org id=B15025.137640488621591 (code B ref 15025); Tue, 13 Aug 2013 14:42:02 +0000 Original-Received: (at 15025) by debbugs.gnu.org; 13 Aug 2013 14:41:26 +0000 Original-Received: from localhost ([127.0.0.1]:56684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9Fmn-0005cA-W1 for submit@debbugs.gnu.org; Tue, 13 Aug 2013 10:41:26 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:32775 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9Fmk-0005bz-3l for 15025@debbugs.gnu.org; Tue, 13 Aug 2013 10:41:22 -0400 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1V9Fmi-00075r-Dd; Tue, 13 Aug 2013 10:41:20 -0400 In-Reply-To: <5208985B.9010106@yandex.ru> (Dmitry Antipov's message of "Mon, 12 Aug 2013 12:10:03 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77318 Archived-At: Dmitry Antipov writes: > On 08/10/2013 01:54 AM, Dan Nicolaescu wrote: > >> Unfortunately I won't have time to debug this any time soon. >> But the recipe I gave shows the problem every time, so hopefully someone >> can track down the problem. > > Finally I got it reproduced. Very nasty and long-standing issue (I'm pretty > sure that it was there before r111121). > > The problem is that candidate_frame looks for 1) frames which shares the > keyboard for graphical frames or 2) frames which share the TTY for termcap > frames. But with Dan's example, we have: > > (gdb) p XFRAME (frame) > $20 = (struct frame *) 0x108c6e0 ; argument of `next_frame' > > And in Vframe_list: > > (gdb) p XFRAME (XCAR (Vframe_list)) > $27 = (struct frame *) 0x10756e0 > (gdb) p XFRAME (XCAR (Vframe_list))->terminal > $28 = (struct terminal *) 0x1075570 ; TTY /dev/pts/X > (gdb) p XFRAME (XCAR (Vframe_list))->output_method > $29 = output_termcap > > (gdb) p XFRAME (XCAR (XCDR (Vframe_list))) > $30 = (struct frame *) 0x108c6e0 > (gdb) p XFRAME (XCAR (XCDR (Vframe_list)))->terminal > $31 = (struct terminal *) 0xbeba70 ; TTY /dev/pts/Y > (gdb) p XFRAME (XCAR (XCDR (Vframe_list)))->output_method > $32 = output_termcap > > Two TTY frames on a different TTYs! So, candidate_frame always returns Qnil. Does this happen because two TTY frames got killed at the same time (because the xterm they were running on was killed)? Does emacs think that those frames are still alive? What is the goal when looking for frames that share the TTY ? [I don't know what the code in question is trying to do...] > But the problem is much more interesting than redesign this: > > if ((!FRAME_TERMCAP_P (c) && !FRAME_TERMCAP_P (f) > && FRAME_KBOARD (c) == FRAME_KBOARD (f)) > || (FRAME_TERMCAP_P (c) && FRAME_TERMCAP_P (f) > && FRAME_TTY (c) == FRAME_TTY (f))) > > IIUC, TTY "peers" (which was on xterms connected to :1) of Emacs frames becomes > invalid when Xnest dies. I suspect that we should have a method to handle such > a "TTY disconnect", but currently I have no ideas how to implement this :-(.