GNU bug report logs -
#12196
24.1.50; setting cache-long-line-scans to non-nil freezes Emacs
Previous Next
Reported by: michael_heerdegen <at> web.de
Date: Tue, 14 Aug 2012 05:01:01 UTC
Severity: normal
Found in version 24.1.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 12196 <at> debbugs.gnu.org (full text, mbox):
> From: Christopher Schmidt <christopher <at> ch.ristopher.com>
> Cc: bug-gnu-emacs <at> 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;
This bug report was last modified 12 years and 310 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.