From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#7722: 24.0.50; Finding this C++ header file drops emacs into a infinite loop Date: Sun, 13 Feb 2011 12:20:44 +0000 Message-ID: <20110213122044.GB2078@muc.de> References: <87fwtnbmmj.fsf@member.fsf.org> <87hbd0y8sb.fsf@stupidchicken.com> <20110204222207.GA2424@muc.de> <8739nu82od.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1297599594 3070 80.91.229.12 (13 Feb 2011 12:19:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Feb 2011 12:19:54 +0000 (UTC) Cc: 7722@debbugs.gnu.org, Tassilo Horn To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 13 13:19:48 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Poavb-0003KL-IG for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Feb 2011 13:19:47 +0100 Original-Received: from localhost ([127.0.0.1]:47429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Poava-0006AB-VE for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Feb 2011 07:19:47 -0500 Original-Received: from [140.186.70.92] (port=59683 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Poail-0006Z5-Px for bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 07:06:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Poaie-0008HD-GR for bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 07:06:25 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Poaic-0008Ge-Mb; Sun, 13 Feb 2011 07:06:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PoaYc-0008Fl-GQ; Sun, 13 Feb 2011 06:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 13 Feb 2011 11:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7722 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 7722-submit@debbugs.gnu.org id=B7722.129759816131716 (code B ref 7722); Sun, 13 Feb 2011 11:56:02 +0000 Original-Received: (at 7722) by debbugs.gnu.org; 13 Feb 2011 11:56:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoaYa-0008FV-CU for submit@debbugs.gnu.org; Sun, 13 Feb 2011 06:56:00 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoaYX-0008FI-4j for 7722@debbugs.gnu.org; Sun, 13 Feb 2011 06:55:58 -0500 Original-Received: (qmail 7003 invoked by uid 3782); 13 Feb 2011 12:04:50 -0000 Original-Received: from acm.muc.de (pD9E53CC3.dip.t-dialin.net [217.229.60.195]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 13 Feb 2011 13:04:48 +0100 Original-Received: (qmail 4317 invoked by uid 1000); 13 Feb 2011 12:20:44 -0000 Content-Disposition: inline In-Reply-To: <8739nu82od.fsf@stupidchicken.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 13 Feb 2011 06:56:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44095 Archived-At: Hi, Yidong! On Fri, Feb 11, 2011 at 08:25:06PM -0500, Chong Yidong wrote: > Alan Mackenzie writes: > > It was indeed such a loop. It was caused by a 500n jit-lock boundary > > falling in the middle of a template construct, hence the "necessity" of > > all the whitespace to reproduce the failure. > > Here's a putative patch for the problem. I've refactored the offending > > function by replacing obscenely nested `if'-forms with a simple `cond'. > > I've also removed some narrowing (to the 500n limit) which should help > > jit-lock, hopefully without hurting too much elsewhere. > > Tassilo, would you try out the patch, please, and let me know how it > > goes. Thanks! > Thanks. This patch doesn't apply cleanly to the emacs-23 branch. That surprises me. Would you like me to rework the patch so that it does? > Do you think we could apply it to the trunk, and just use the > workaround in the branch .... To be honest, I haven't really looked at the workaround. I suppose it would be OK. However, the patched version passed all the CC Mode regression tests (which are about half indentation, half font-locking), so I'm fairly confident about it. > .... (some of these logic changes don't look obvious to me)? One of the fixes was removing a `narrow-to-region' around the region being fontified. In a jit-lock 500-byte chunk, this had the effect of cutting necessary context off the end. The other change was basically to refactor, in which the infinite looping disappeared in the wash. Although I could get edebug going on this loop, the source was just too complicated to be worthwhile trying to understand in detail. (Believe me, I tried. :-) Incidentally, I'm not getting mail from emacs-devel or bug-gnu-emacs at the moment, and I've not got enough energy to do anything about it. Do you know anything specific which might be doing this to me? -- Alan Mackenzie (Nuremberg, Germany).