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#7952: 24.0.50; crash in find_interval Date: Fri, 29 Apr 2011 21:17:20 +0300 Message-ID: <834o5g7wi7.fsf@gnu.org> References: <87r5ag7a72.fsf@silenus.orebokech.com> <87lj0c1bj8.fsf@silenus.orebokech.com> <8339mkrzic.fsf@gnu.org> <87ei6417kl.fsf@silenus.orebokech.com> <87tye1x3mv.fsf@stupidchicken.com> <87y62xh0ep.fsf@silenus.orebokech.com> <83pqo899y4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1304102225 2979 80.91.229.12 (29 Apr 2011 18:37:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2011 18:37:05 +0000 (UTC) Cc: 7952-done@debbugs.gnu.org To: romain@orebokech.com, cyd@stupidchicken.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 29 20:37:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QFsYl-0003i6-Qe for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2011 20:36:59 +0200 Original-Received: from localhost ([::1]:55870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFsYl-0004KS-95 for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2011 14:36:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFsYj-0004JT-3S for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2011 14:36:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFsYh-0002Qp-Ma for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2011 14:36:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFsYh-0002Ql-Ja for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2011 14:36:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QFsGR-0007nK-2C for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2011 14:18:03 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Apr 2011 18:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 7952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 7952@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 7952-done@debbugs.gnu.org id=D7952.130410105529922 (code D ref 7952); Fri, 29 Apr 2011 18:18:02 +0000 Original-Received: (at 7952-done) by debbugs.gnu.org; 29 Apr 2011 18:17:35 +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 1QFsFz-0007mY-ER for submit@debbugs.gnu.org; Fri, 29 Apr 2011 14:17:35 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFsFx-0007mM-7T for 7952-done@debbugs.gnu.org; Fri, 29 Apr 2011 14:17:34 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LKF00900EQ2P100@a-mtaout20.012.net.il> for 7952-done@debbugs.gnu.org; Fri, 29 Apr 2011 21:17:20 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.124.150.132]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LKF009K7ESU0UD0@a-mtaout20.012.net.il>; Fri, 29 Apr 2011 21:17:20 +0300 (IDT) In-reply-to: <83pqo899y4.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 29 Apr 2011 14:18:03 -0400 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: , 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:46080 Archived-At: > Date: Tue, 26 Apr 2011 20:52:35 +0300 > From: Eli Zaretskii > Cc: cyd@stupidchicken.com, 7952@debbugs.gnu.org > > > From: Romain Francoise > > Cc: Chong Yidong , 7952@debbugs.gnu.org > > Date: Tue, 26 Apr 2011 10:39:10 +0200 > > > > Any chance some intervals expert could look at this bug? > > I'm no expert on this, but I will try this weekend, if no one beats me > to it. I found the reason. It had nothing to do with intervals: in an Emacs compiled with -DENABLE_CHECKING the crash happens earlier, inside set_point_both, because the value of point passed to it is greater than the buffer size. The problem is that the new fontification in Grep buffers can modify buffer text, e.g. when it finds an escape sequence emitted by Grep. The other part of the puzzle is that vertical-motion, called from window_scroll_line_based as part of handling M-v or C-v, enters redisplay, which triggers JIT Lock fontification. Here's the Lisp-level backtrace from GDB; note the call to replace-match: "replace-match" (0x82d760) "progn" (0x82d940) "eval" (0x82da14) "font-lock-fontify-keywords-region" (0x82dc54) "font-lock-default-fontify-region" (0x82de94) "font-lock-fontify-region" (0x82e1f8) "run-hook-with-args" (0x82e1f4) "byte-code" (0x82e3a0) "jit-lock-fontify-now" (0x82e774) "jit-lock-function" (0x82eae4) "scroll-down" (0x82f674) "scroll-down-command" (0x82f8f4) "call-interactively" (0x82fb84) So the value of point saved by window_scroll_line_based becomes invalid after vertical-motion returns, and the rest is history. I fixed this on the trunk (revision 104055). Emacs-23 branch has the same problem, but I'd like to hear Stefan's and Chong's opinion whether to install this change there as well (since Grep buffer fontifications that trigger this problem were only introduced on the trunk, and since the code in question survived without changes since the 1990s).