Subject: Re: bug#9739: 24.0.90; abort at find_row_edges xdisp.c:18714

From: Eli Zaretskii <[email-masked]>
Date: Wed, 12 Oct 2011 22:16:16 +0200

> From: Haitao Li <[email-masked]>
> Date: Thu, 13 Oct 2011 03:07:57 +0800
> Cc: [email-masked]
> 
> BTW, I just found the crash first happened on this revision. It works
> okay on the version before that. (Sorry for not using bzr version
> number.)
> 
> commit 00d451f4f7f9b9fef08a36c9d61b6f803480d1ba
> Author: Eli Zaretskii
> Date:   Tue Sep 20 20:13:45 2011 +0300
> 
>    Fix bug #9549 with longlines-show-hard-newlines.
> 
>     src/xdisp.c (set_cursor_from_row): If the row ends in a newline from
>     a display string, extend search for cursor position to end of row.
>     (find_row_edges): If the row ends in a newline from a display
>     string, increment its MATRIX_ROW_END_CHARPOS by one.
>     Handle the case of a display string with multiple newlines.

Yes, the code that aborts was introduced in that revision.

I think I fixed the crash, please try the latest bzr.  Or apply the
patch below.

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2011-10-12 19:08:04 +0000
+++ src/ChangeLog	2011-10-12 20:07:59 +0000
@@ -1,3 +1,9 @@
+2011-10-12  Eli Zaretskii  <[email-masked]>
+
+	* xdisp.c (find_row_edges): Handle the case where ROW comes from a
+	display string and the previous row comes from the same string and
+	is empty.  (Bug#9739)  (Bug#9738)
+
 2011-10-12  Stefan Monnier  <[email-masked]>
 
 	* doc.c (get_doc_string): Encode file name (bug#9735).

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2011-10-12 15:12:52 +0000
+++ src/xdisp.c	2011-10-12 20:07:59 +0000
@@ -18646,7 +18646,12 @@ find_row_edges (struct it *it, struct gl
 		    seen_this_string = 1;
 		}
 	      else
-		abort ();
+		/* If all the glyphs of the previous row were inserted
+		   by redisplay, it means the previous row was
+		   produced from a single newline, which is only
+		   possible if that newline came from the same string
+		   as the one which produced this ROW.  */
+		seen_this_string = 1;
 	    }
 	  else
 	    {
@@ -18662,7 +18667,7 @@ find_row_edges (struct it *it, struct gl
 		    seen_this_string = 1;
 		}
 	      else
-		abort ();
+		seen_this_string = 1;
 	    }
 	}
       /* Take note of each display string that covers a newline only