From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: emacs 24 randomly hanging Date: Wed, 22 Feb 2012 10:41:31 +0100 Message-ID: <4F44B84B.5020203@gmx.at> References: <878vjzz920.fsf@earth.home> <87sji4mpwn.fsf@this.that> <4F43CC35.60407@gmx.at> <8762f0qbam.fsf@this.that> <4F44A6A2.8040701@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010103090008000801030608" X-Trace: dough.gmane.org 1329903740 1617 80.91.229.3 (22 Feb 2012 09:42:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 09:42:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 22 10:42:17 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S08iH-0004SV-Js for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 10:42:17 +0100 Original-Received: from localhost ([::1]:39791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S08iG-00013u-M1 for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 04:42:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S08i4-00013d-Rp for emacs-devel@gnu.org; Wed, 22 Feb 2012 04:42:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S08hy-00072e-He for emacs-devel@gnu.org; Wed, 22 Feb 2012 04:42:04 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:39163) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S08hy-00072a-8w for emacs-devel@gnu.org; Wed, 22 Feb 2012 04:41:58 -0500 Original-Received: (qmail invoked by alias); 22 Feb 2012 09:41:56 -0000 Original-Received: from 62-47-38-254.adsl.highway.telekom.at (EHLO [62.47.38.254]) [62.47.38.254] by mail.gmx.net (mp030) with SMTP; 22 Feb 2012 10:41:56 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/X/pQck/bXMisoP0Lj4mxIb57Zwlraj9wcpStFdh ezy8Q+pGa6NLTM In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148704 Archived-At: This is a multi-part message in MIME format. --------------010103090008000801030608 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit >> what's going on here, IIUC it takes some time (at least a couple of >> seconds) for a frame to show up on Vframe_list. > > It should not matter at all, because x_create_frame cannot make the new > frame known to lisp before it is added to Vframe_alist. I suppose you mean Vframe_list. At least on my system I can see frames that are not returned by `frame-list'. >> (1) Check whether the frame passed to next_frame is in Vframe_list and >> quit if it isn't. >> >> (2) Put a maximum of 100 frames investigated on the loop in next_frame >> so there should be no endless looping otherwise. > > This is just doctoring the symptoms. What did you expect me to do? I first have to find out whether the looping really is in next_frame. Or do you have a definitive clue? BTW my doctoring patch has an obvious bug which should be corrected in the new attachment. > There is an invariant that *every* > live frame is on Vframe_alist. If that invariant is violated then this > is the bug that must be fixed. Such an invariant seems obvious but I don't see it neither formulated nor preserved. And why is Vframe_alist "V" prefixed but not available in Lisp? martin --------------010103090008000801030608 Content-Type: text/plain; name="frame.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="frame.c.diff" === modified file 'src/frame.c' *** src/frame.c 2012-01-19 07:21:25 +0000 --- src/frame.c 2012-02-22 09:30:41 +0000 *************** *** 935,992 **** forever. Forestall that. */ CHECK_LIVE_FRAME (frame); ! while (1) for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) { Lisp_Object f; f = XCAR (tail); ! if (passed ! && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame)) ! && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) ! || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame)) ! && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))) { - /* Decide whether this frame is eligible to be returned. */ - /* If we've looped all the way around without finding any eligible frames, return the original frame. */ if (EQ (f, frame)) return f; ! ! /* Let minibuf decide if this frame is acceptable. */ ! if (NILP (minibuf)) ! { ! if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) ! return f; ! } ! else if (EQ (minibuf, Qvisible)) ! { ! FRAME_SAMPLE_VISIBILITY (XFRAME (f)); ! if (FRAME_VISIBLE_P (XFRAME (f))) ! return f; ! } ! else if (INTEGERP (minibuf) && XINT (minibuf) == 0) ! { ! FRAME_SAMPLE_VISIBILITY (XFRAME (f)); ! if (FRAME_VISIBLE_P (XFRAME (f)) ! || FRAME_ICONIFIED_P (XFRAME (f))) ! return f; ! } ! else if (WINDOWP (minibuf)) { ! if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) ! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f) ! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), ! FRAME_FOCUS_FRAME (XFRAME (f)))) ! return f; } - else - return f; } ! if (EQ (frame, f)) passed++; } } --- 935,997 ---- forever. Forestall that. */ CHECK_LIVE_FRAME (frame); ! while (!NILP (Fmemq (frame, Vframe_list)) && (passed < 100)) for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) { Lisp_Object f; f = XCAR (tail); ! if (passed) { /* If we've looped all the way around without finding any eligible frames, return the original frame. */ if (EQ (f, frame)) return f; ! else { ! passed++; ! ! /* Decide whether this frame is eligible to be returned. */ ! if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame)) ! && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) ! || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame)) ! && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))) ! { ! /* Let minibuf decide if this frame is acceptable. */ ! if (NILP (minibuf)) ! { ! if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) ! return f; ! } ! else if (EQ (minibuf, Qvisible)) ! { ! FRAME_SAMPLE_VISIBILITY (XFRAME (f)); ! if (FRAME_VISIBLE_P (XFRAME (f))) ! return f; ! } ! else if (INTEGERP (minibuf) && XINT (minibuf) == 0) ! { ! FRAME_SAMPLE_VISIBILITY (XFRAME (f)); ! if (FRAME_VISIBLE_P (XFRAME (f)) ! || FRAME_ICONIFIED_P (XFRAME (f))) ! return f; ! } ! else if (WINDOWP (minibuf)) ! { ! if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) ! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f) ! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), ! FRAME_FOCUS_FRAME (XFRAME (f)))) ! return f; ! } ! else ! return f; ! } } } ! else if (EQ (frame, f)) passed++; } } --------------010103090008000801030608--