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#21205: Error during redisplay: (jit-lock-function 3491) Date: Fri, 7 Aug 2015 20:52:55 +0000 Message-ID: <20150807205255.GA2653@acm.fritz.box> References: <368A8AC0-E908-4419-A05C-0B0CEA6F0521@icloud.com> <83zj23qmx9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1438980805 13454 80.91.229.3 (7 Aug 2015 20:53:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Aug 2015 20:53:25 +0000 (UTC) Cc: 21205@debbugs.gnu.org To: Eli Zaretskii , netjune@icloud.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 07 22:53:14 2015 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 1ZNode-0007Hs-0i for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Aug 2015 22:53:14 +0200 Original-Received: from localhost ([::1]:51218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNodd-00012j-CX for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Aug 2015 16:53:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNodZ-00012e-CQ for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2015 16:53:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNodY-0004yj-91 for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2015 16:53:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNodS-0004xw-IR; Fri, 07 Aug 2015 16:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZNodS-0007mi-64; Fri, 07 Aug 2015 16:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 07 Aug 2015 20:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21205 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 21205-submit@debbugs.gnu.org id=B21205.143898072829863 (code B ref 21205); Fri, 07 Aug 2015 20:53:02 +0000 Original-Received: (at 21205) by debbugs.gnu.org; 7 Aug 2015 20:52:08 +0000 Original-Received: from localhost ([127.0.0.1]:50411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNocZ-0007lb-S3 for submit@debbugs.gnu.org; Fri, 07 Aug 2015 16:52:08 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:48758) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNocX-0007lR-4Q for 21205@debbugs.gnu.org; Fri, 07 Aug 2015 16:52:06 -0400 Original-Received: (qmail 60973 invoked by uid 3782); 7 Aug 2015 20:52:02 -0000 Original-Received: from acm.muc.de (p548A5DBA.dip0.t-ipconnect.de [84.138.93.186]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 07 Aug 2015 22:52:01 +0200 Original-Received: (qmail 4656 invoked by uid 1000); 7 Aug 2015 20:52:55 -0000 Content-Disposition: inline In-Reply-To: <83zj23qmx9.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:105363 Archived-At: Hello, Eli and Netjune. On Fri, Aug 07, 2015 at 03:54:10PM +0300, Eli Zaretskii wrote: > > From: 张海君 > > Date: Fri, 07 Aug 2015 18:43:54 +0800 > > Run emacs with "emacs -Q", and then eval the following code: > > ------------------------------------------------------------ > > (setq font-lock-maximum-decoration 2 > > jit-lock-defer-time 0.05) > > (setq-default show-trailing-whitespace t) > > ------------------------------------------------------------ > > Then open the attached c file, and scroll down the buffer with key C-v C-v ... until the end of buffer. > > Switch to the message buffer *Message*. There are some error message as the following: > > ------------------------------------------------------------------------------ > > Error during redisplay: (jit-lock-function 3102) signaled (error "Invalid search bound (wrong side of point)") > The errors are triggered by c-syntactic-re-search-forward. Here's the > backtrace from the first such error, with the current master: [ .... ] > Lisp Backtrace: > "re-search-forward" (0x825430) > "c-syntactic-re-search-forward" (0x8259f0) > "c-font-lock-declarators" (0x825fd0) > 0x1c9cda0 PVEC_COMPILED > "font-lock-fontify-keywords-region" (0x826b30) > "font-lock-default-fontify-region" (0x8270d0) > "c-font-lock-fontify-region" (0x827680) > "font-lock-fontify-region" (0x827c28) [ .... ] Thanks for that, Eli! It made it fairly easy to track down the bug, which was simply failing to check if point had advanced too far at one critical place in c-font-lock-declarators. Netjune: would you please try out the following patch (it should apply cleanly to the cc-fonts.el in ..../emacs-24.5/lisp/progmodes/), and confirm that the bug has been fixed, or tell me what is still causing problems. diff -r 88b4140d56af cc-fonts.el --- a/cc-fonts.el Tue May 12 10:03:55 2015 +0000 +++ b/cc-fonts.el Fri Aug 07 20:41:38 2015 +0000 @@ -1141,6 +1141,7 @@ (looking-at "{")) (c-safe (c-forward-sexp) t) ; over { .... } t) + (< (point) limit) ;; FIXME: Should look for c-decl-end markers here; ;; we might go far into the following declarations ;; in e.g. ObjC mode (see e.g. methods-4.m). Thanks for the bug report! -- Alan Mackenzie (Nuremberg, Germany).