GNU bug report logs - #38407
27.0.50; infinite loop with display of large file without newlines

Previous Next

Package: emacs;

Reported by: Pieter van Oostrum <pieter <at> vanoostrum.org>

Date: Wed, 27 Nov 2019 22:07:01 UTC

Severity: normal

Found in version 27.0.50

Full log


Message #92 received at 38407 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, pieter <at> vanoostrum.org,
 38407 <at> debbugs.gnu.org
Subject: Re: bug#38407: 27.0.50; infinite loop with display of large file
 without newlines
Date: Tue, 03 Dec 2019 12:20:26 +0100
>>>>> On Mon, 02 Dec 2019 11:27:10 +0100, Robert Pluim <rpluim <at> gmail.com> said:

>>>>> On Sun, 01 Dec 2019 19:45:11 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
    Robert> bidi-inhibit-bpa nil:

    Robert> # Overhead  Command       Shared Object                  Symbol
    Robert> # ........  ............  .............................  ..........................................................
    Robert> #
    Robert>     96.59%  emacs         libc-2.29.so                   [.] __memmove_avx_unaligned_erms
    Robert>      0.22%  emacs         emacs                          [.] mark_object
    Robert>      0.17%  emacs         emacs                          [.] composition_compute_stop_pos
    Robert>      0.12%  emacs         emacs                          [.] re_match_2_internal

So further messing with perf leads me to the following code in
move_it_in_display_line_to:

	{
	  if (it->line_wrap == WORD_WRAP && it->area == TEXT_AREA)
	    {
	      if (IT_DISPLAYING_WHITESPACE (it))
		may_wrap = true;
	      else if (may_wrap)
		{
		  /* We have reached a glyph that follows one or more
		     whitespace characters.  If the position is
		     already found, we are done.  */
		  if (atpos_it.sp >= 0)
		    {
		      RESTORE_IT (it, &atpos_it, atpos_data);
		      result = MOVE_POS_MATCH_OR_ZV;
		      goto done;
		    }
		  if (atx_it.sp >= 0)
		    {
		      RESTORE_IT (it, &atx_it, atx_data);
		      result = MOVE_X_REACHED;
		      goto done;
		    }
		  /* Otherwise, we can wrap here.  */
		  SAVE_IT (wrap_it, *it, wrap_data);          <=====
		  may_wrap = false;
		}
	    }
	}

That SAVE_IT is what causes the __memmove_avx_unaligned_erms to show
up so high in the trace (via bidi_shelve_cache).

Robert




This bug report was last modified 5 years and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.