GNU bug report logs -
#77065
31.0.50; Infinite loop in move_it_to
Previous Next
Reported by: Yifan Zhu <fanzhuyifan <at> gmail.com>
Date: Mon, 17 Mar 2025 07:54:03 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #52 received at 77065-done <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 20 Mar 2025 09:39:03 -0700
> Cc: 77065 <at> debbugs.gnu.org
> From: Yifan Zhu <fanzhuyifan <at> gmail.com>
>
> On 3/20/25 3:39 AM, Eli Zaretskii wrote:
> > But the
> > patch below should fix this particular problem, I think; please try
> > it and tell if it avoids the infloop.
> >
> > diff --git a/src/xdisp.c b/src/xdisp.c
> > index c396b213..90ec187 100644
> > --- a/src/xdisp.c
> > +++ b/src/xdisp.c
> > @@ -10295,10 +10295,10 @@ #define IT_RESET_X_ASCENT_DESCENT(IT) \
> > {
> > bool moved_forward = false;
> >
> > - if (/* IT->hpos == 0 means the very first glyph
> > - doesn't fit on the line, e.g. a wide
> > - image. */
> > - it->hpos == 0
> > + if (/* IT->hpos == 0 (modulo line-number width) means
> > + the very first glyph doesn't fit on the line,
> > + e.g., a wide image. */
> > + it->hpos == 0 + (it->lnum_width ? it->lnum_width + 2 : 0)
> > || (new_x == it->last_visible_x
> > && FRAME_WINDOW_P (it->f)))
> > {
>
> Thanks! I applied the patch and can no longer reproduce the freezing
> issue I encountered. There seems to be some display issues in
> visual-line-mode, but those don't seem to be regressions and I will
> report those separately.
Thanks, I've now installed the change on the master branch, and I will
close this bug.
> Searching through the file, there are multiple other occurrences of
> "IT->hpos == 0". Do those need to be changed as well?
Only one, which I did. The others are either really for hpos == 0 or
have some other heuristics that covers this case.
This bug report was last modified 60 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.