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#12196: 24.1.50; setting cache-long-line-scans to non-nil freezes Emacs Date: Mon, 10 Sep 2012 14:10:25 +0300 Message-ID: <83ligikuam.fsf@gnu.org> References: <87has6ysxn.fsf@web.de> <834no4jeoa.fsf@gnu.org> <87ehmwscrt.fsf@web.de> <83ehmwh0pn.fsf@gnu.org> <87sjb9g981@ch.ristopher.com> <83oblrqwc1.fsf@gnu.org> <877gs218a3@ch.ristopher.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1347275506 3548 80.91.229.3 (10 Sep 2012 11:11:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2012 11:11:46 +0000 (UTC) Cc: 12196@debbugs.gnu.org To: Christopher Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 10 13:11:48 2012 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 1TB1u8-0007Ef-3r for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 13:11:48 +0200 Original-Received: from localhost ([::1]:44809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB1u4-0007Wk-LR for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 07:11:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB1tx-0007Wb-AM for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 07:11:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TB1to-0000U9-68 for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 07:11:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB1to-0000TC-2A for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 07:11:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TB1uL-0001Qb-Km for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 07:12:01 -0400 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 Resent-Date: Mon, 10 Sep 2012 11:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12196 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12196-submit@debbugs.gnu.org id=B12196.13472754645420 (code B ref 12196); Mon, 10 Sep 2012 11:12:01 +0000 Original-Received: (at 12196) by debbugs.gnu.org; 10 Sep 2012 11:11:04 +0000 Original-Received: from localhost ([127.0.0.1]:51487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TB1tQ-0001PM-7e for submit@debbugs.gnu.org; Mon, 10 Sep 2012 07:11:04 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:59673) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TB1tM-0001Ow-LP for 12196@debbugs.gnu.org; Mon, 10 Sep 2012 07:11:02 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MA400J00SBY7C00@a-mtaout22.012.net.il> for 12196@debbugs.gnu.org; Mon, 10 Sep 2012 14:10:19 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MA400HHUSD6SQO0@a-mtaout22.012.net.il>; Mon, 10 Sep 2012 14:10:19 +0300 (IDT) In-reply-to: <877gs218a3@ch.ristopher.com> 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:64031 Archived-At: > From: Christopher Schmidt > Cc: bug-gnu-emacs@gnu.org > Date: Mon, 10 Sep 2012 11:28:35 +0100 (BST) > > Emacs loops here: > > #0 scan_buffer (target=10, start=6730, end=6749, count=1, shortage=0x7fff171cbbf0, allow_quit=1) at search.c:742 > #1 0x000000000059844f in find_before_next_newline (from=6730, to=0, cnt=1) at search.c:945 > #2 0x00000000005c8c1f in Fline_end_position (n=4) at editfns.c:808 > #3 0x000000000058cdcb in Fend_of_line (n=4) at cmds.c:201 > > p start_byte > $11 = 6750 > p cursor > $12 = (unsigned char *) 0x3ddc6ad ");\n\n\treturn 0;\n}\n\n\n" > p base > $13 = (unsigned char *) 0x3ddc6ad ");\n\n\treturn 0;\n}\n\n\n" > > These values do not change. > > At the beginning of loop (search.c:669): > > p start > $14 = 6730 > p end > $15 = 6749 > > target is '\n' of course. Ultimately the problem boils down to > region_cache_forward (search.c:686) always returning 0 from the first > invocation, thus start_byte (search.c:688) is not modified throughout > the loop. > > #0 region_cache_forward (buf=0x4f1db30, c=0x4bae990, pos=6750, next=0x7fff171cbb38) at region-cache.c:706 > #1 0x0000000000597995 in scan_buffer (target=10, start=6730, end=6749, count=1, shortage=0x7fff171cbbf0, allow_quit=1) at search.c:687 > > p buf->text->z > $21 = 6749 Thanks. Does the patch below help? === modified file 'src/search.c' --- src/search.c 2012-09-04 17:34:54 +0000 +++ src/search.c 2012-09-10 11:07:13 +0000 @@ -681,10 +681,11 @@ scan_buffer (register int target, ptrdif to see where we can avoid some scanning. */ if (target == '\n' && newline_cache) { - ptrdiff_t next_change; + ptrdiff_t next_change = 0; immediate_quit = 0; while (region_cache_forward - (current_buffer, newline_cache, start_byte, &next_change)) + (current_buffer, newline_cache, start_byte, &next_change) + || next_change == Z) start_byte = next_change; immediate_quit = allow_quit;