GNU bug report logs - #21200
25.0.50; xdisp.c: infinite loop when using invisibility specs

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Thu, 6 Aug 2015 19:15:02 UTC

Severity: normal

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; xdisp.c: infinite loop when using invisibility specs
Date: Thu, 6 Aug 2015 18:26:05 +0000
[Message part 1 (text/plain, inline)]
Hi,
with the current git tree (revision 0aec2aac), I'm running into
problems with an infinite loop in xdisp.c which I believe to be fixed
by this patch, which is reasonably obvious:

diff --git a/src/xdisp.c b/src/xdisp.c
index e45cb87..7b221d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4221,6 +4221,8 @@ handle_invisible_prop (struct it *it)
           if (invis == 2)
             display_ellipsis_p = true;
         }
+
+              charpos = end_charpos;
         }
       while (invis != 0 && endpos < len);

in this loop:

      do
        {
          end_charpos = Fnext_single_property_change (charpos, Qinvisible,
                              it->string, limit);
          if (INTEGERP (end_charpos))
        {
          endpos = XFASTINT (end_charpos);
          charpos = end_charpos;
          prop = Fget_text_property (end_charpos, Qinvisible, it->string);
          invis = TEXT_PROP_MEANS_INVISIBLE (prop);
          if (invis == 2)
            display_ellipsis_p = true;
        }
        }
      while (invis != 0 && endpos < len);

Without the patch, we keep calling Fnext_property_change with the same
arguments and expecting a different result, which obviously never
happens. In fact it seems to me we only need one of charpos and
end_charpos as the code currently stands, anyway. However, charpos =
f(..., charpos, ...) might cause confusion.

I can provide more detail if necessary, but as I said, it's a fairly
obvious bug.
[emacs-006.diff (text/plain, attachment)]

This bug report was last modified 9 years and 317 days ago.

Previous Next


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