From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#10664: 24.0.93; JIT font-lock infloops in a C file Date: Wed, 08 Feb 2012 19:49:58 +0200 Message-ID: <83sjil9pvd.fsf@gnu.org> References: <83wr89qcay.fsf@gnu.org> <83bopdcfe5.fsf@gnu.org> <20120206110957.GA2731@acm.acm> <83wr7zc2r2.fsf@gnu.org> <20120207192032.GA17530@acm.acm> <83y5se9x9a.fsf@gnu.org> <20120207213401.GB17530@acm.acm> <20120208114749.GA3523@acm.acm> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1328723473 18475 80.91.229.3 (8 Feb 2012 17:51:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2012 17:51:13 +0000 (UTC) Cc: 10664@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 08 18:51:11 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1RvBfj-00018X-K8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Feb 2012 18:51:11 +0100 Original-Received: from localhost ([::1]:41783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvBfj-0000ru-4L for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Feb 2012 12:51:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvBff-0000rm-TR for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2012 12:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvBfb-0003M1-NV for bug-gnu-emacs@gnu.org; Wed, 08 Feb 2012 12:51:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvBfX-0003Ll-Mb; Wed, 08 Feb 2012 12:50:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RvBgX-0007Um-Vx; Wed, 08 Feb 2012 12:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 08 Feb 2012 17:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10664 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 10664-submit@debbugs.gnu.org id=B10664.132872351628798 (code B ref 10664); Wed, 08 Feb 2012 17:52:01 +0000 Original-Received: (at 10664) by debbugs.gnu.org; 8 Feb 2012 17:51:56 +0000 Original-Received: from localhost ([127.0.0.1]:60925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvBgR-0007UQ-Sw for submit@debbugs.gnu.org; Wed, 08 Feb 2012 12:51:56 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:55655) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvBgN-0007U8-AC for 10664@debbugs.gnu.org; Wed, 08 Feb 2012 12:51:52 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LZ3005005I6RN00@a-mtaout23.012.net.il> for 10664@debbugs.gnu.org; Wed, 08 Feb 2012 19:49:54 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.149.156]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LZ3005MX5J4QB20@a-mtaout23.012.net.il>; Wed, 08 Feb 2012 19:49:54 +0200 (IST) In-reply-to: <20120208114749.GA3523@acm.acm> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:56696 Archived-At: > Date: Wed, 8 Feb 2012 11:47:49 +0000 > Cc: Eli Zaretskii , 10664@debbugs.gnu.org > From: Alan Mackenzie > > ######################################################################### > 1 template > 2 > 3 > 4 void myfunc(T* p) {} > ######################################################################### > > This is fontified correctly. Type a space on L2. This is OK for half a > second, then context fontification messes up L4. The correct > fontification can only be restored by a change to L4. > > Revision #106729 fixes this problem, after a space on L2, by making the > fontification start at L1 rather than L2. > > The exact mechanism of why the problem happened is buried in my log, and > I could dredge it up if you're really interested. > > The problem with this approach is demonstrated in Eli's socket.c: > > SCM_DEFINE (scm_inet_pton, "inet-pton", 2, 0, 0, > (SCM family, SCM address), > "Convert a string containing a printable network address to\n" > "an integer address. Note that unlike the C version of this\n" > "function,\n" > "the result is an integer with normal host byte ordering.\n" > "@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,\n\n" > "@lisp\n" > "(inet-pton AF_INET \"127.0.0.1\") @result{} 2130706433\n" > "(inet-pton AF_INET6 \"::1\") @result{} 1\n" > "@end lisp") > #define FUNC_NAME s_scm_inet_pton > { > > A 500 byte chunk of fontification ends just before "@end lisp". For > this line, the start of the next chunk is "pushed back" to the > SCM_DEFINE line to get a proper context for "@end lisp". It then > repeatedly fontifies the same chunk. > > Interestingly, EOL just before "@end lisp" is exactly 500 bytes after > the initial scm_inet_pton. Thanks for explaining this. Would it fix the problem if, when jit-lock is "pushed back" by N >= 500 characters, it will fontify N + n characters, where n > 0 ? (E.g., set n = 100.)