GNU bug report logs - #11199
24.0.95; killing right-to-left text at eob leads to inconsistent state

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Sun, 8 Apr 2012 02:28:02 UTC

Severity: normal

Found in version 24.0.95

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

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: mituharu <at> math.s.chiba-u.ac.jp, Michael Welsh Duggan <md5i <at> md5i.com>
Cc: 11199 <at> debbugs.gnu.org
Subject: Re: bug#11199: 24.0.95;
	killing right-to-left text at eob leads to inconsistent state
Date: Mon, 09 Apr 2012 14:07:43 +0300
> Date: Mon, 09 Apr 2012 13:17:33 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 11199 <at> debbugs.gnu.org
> 
> > Date: Mon, 09 Apr 2012 18:48:16 +0900
> > From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
> > Cc: Michael Welsh Duggan <md5i <at> md5i.com>,
> > 	11199 <at> debbugs.gnu.org
> > 
> > >   (gdb) pmtxrows w->current_matrix
> > >   0: edges=(1,78),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   1: edges=(78,141),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   2: edges=(141,191),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   3: edges=(191,192),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   4: edges=(192,199),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   5: edges=(199,237),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   6: edges=(237,305),r2l=0,cont=0,trunc=(0,0),at_zv=0
> > >   7: edges=(305,309),r2l=0,cont=0,trunc=(0,0),at_zv=1
> > (snip)
> > 
> > What is shown by 
> > 
> >   (gdb) p w->current_matrix->rows[6].end.pos
> > 
> > at this stage?  I get
> > 
> >   $7 = {
> >     charpos = 308, 
> >     bytepos = 311
> >   }
> > 
> > and it looks "out of sync" because edges=(237,305) for the 6th row.
> > I hope this is also reproducible at your side.
> 
> It is, thanks!  I now have a lead for my debugging.  Stay tuned.

Does the patch below fixes the problem?  It does not fix the root
cause, but should work around it well enough for the release branch.
I will install a better (but more risky) fix on the trunk.

(There was nothing wrong with the end.pos values above, as long as the
Hebrew text in the next line existed: end.pos gives the position of
the leftmost character on display in that line, which is not
necessarily the first character after the newline.  The problem is
that init_to_row_end should not use row->end at all.)

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-03-31 19:30:53 +0000
+++ src/xdisp.c	2012-04-09 10:58:59 +0000
@@ -17137,7 +17137,8 @@ try_window_id (struct window *w)
       if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (last_unchanged_at_beg_row))
 	GIVE_UP (17);
 
-      if (init_to_row_end (&it, w, last_unchanged_at_beg_row) == 0)
+      if (CHARPOS (last_unchanged_at_beg_row->end.pos) > ZV
+	  || init_to_row_end (&it, w, last_unchanged_at_beg_row) == 0)
 	GIVE_UP (18);
       start_pos = it.current.pos;
 





This bug report was last modified 13 years and 40 days ago.

Previous Next


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