From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.bugs Subject: bug#15025: emacs --daemon stuck in infinite loop Date: Mon, 12 Aug 2013 12:10:03 +0400 Message-ID: <5208985B.9010106@yandex.ru> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1376295083 25300 80.91.229.3 (12 Aug 2013 08:11:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Aug 2013 08:11:23 +0000 (UTC) Cc: Dan Nicolaescu , Paul Eggert To: 15025@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 12 10:11:24 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 1V8nDk-0003sc-O0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Aug 2013 10:11:20 +0200 Original-Received: from localhost ([::1]:53623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8nDj-0003fZ-Oi for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Aug 2013 04:11:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8nDa-0003fR-DE for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2013 04:11:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8nDT-0001ou-F9 for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2013 04:11:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8nDT-0001oq-Bx for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2013 04:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V8nDS-0003aO-H9 for bug-gnu-emacs@gnu.org; Mon, 12 Aug 2013 04:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Antipov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Aug 2013 08:11: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.137629501613725 (code B ref 15025); Mon, 12 Aug 2013 08:11:02 +0000 Original-Received: (at 15025) by debbugs.gnu.org; 12 Aug 2013 08:10:16 +0000 Original-Received: from localhost ([127.0.0.1]:54023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V8nCh-0003ZH-2I for submit@debbugs.gnu.org; Mon, 12 Aug 2013 04:10:15 -0400 Original-Received: from forward2l.mail.yandex.net ([84.201.143.145]:35417) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V8nCd-0003Yw-9Y for 15025@debbugs.gnu.org; Mon, 12 Aug 2013 04:10:12 -0400 Original-Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward2l.mail.yandex.net (Yandex) with ESMTP id 8A8971AC0E20; Mon, 12 Aug 2013 12:10:04 +0400 (MSK) Original-Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 0424DE40647; Mon, 12 Aug 2013 12:10:03 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTP id oaHWpWQX2j-A308aa2H; Mon, 12 Aug 2013 12:10:03 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1376295003; bh=0i2/pQovrfBwQ/coVm0/YQC24aVARCHBfLhsePVZOFE=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=al8DaNz/f4481ql9insf0FGjDycn7NTFb8DnMGYXaHjYlwavs+yM8r30rhtlChyWs nsJwV9/ete7e9/N1zVeXrIlD6Yng520d64LeJP7SVJA82OsYOBy10BKQM1PP87Pobp NauHBvLkZduXIBg41/5YJihjDpwTu8piV+jWXWbc= Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: 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:77266 Archived-At: 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. 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 :-(. Dmitry