all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9495: 24.0.50; Segfault in try_cursor_movement
@ 2011-09-13 19:28 Johan Bockgård
  2011-09-14  5:22 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Bockgård @ 2011-09-13 19:28 UTC (permalink / raw)
  To: 9495


Program terminated with signal 11, Segmentation fault.
#0  0x00007f5bccbe6fe7 in kill () at ../sysdeps/unix/syscall-template.S:82
82      ../sysdeps/unix/syscall-template.S: No such file or directory.
        in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0  0x00007f5bccbe6fe7 in kill () at ../sysdeps/unix/syscall-template.S:82
#1  0x000000000056e889 in fatal_error_signal (sig=11) at emacs.c:358
#2  <signal handler called>
#3  0x0000000000465f3f in try_cursor_movement (window=20987605, startp=...,
    scroll_step=0x7fff5e400758) at xdisp.c:14639

xdisp.c:14639: (BUFFERP (g->object) && g->charpos == PT)

g is not a valid glyph here.

(gdb) p MATRIX_ROW (w->current_matrix, w->cursor.vpos).used[TEXT_AREA]
$3 = 80
(gdb) p w->cursor.hpos
$4 = 80


2011-09-13  Johan Bockgård  <bojohan@gnu.org>

	* xdisp.c (try_cursor_movement): Check bounds of hpos.

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2011-09-09 01:06:52 +0000
+++ src/xdisp.c	2011-09-11 15:03:56 +0000
@@ -14627,7 +14627,11 @@ try_cursor_movement (Lisp_Object window,
 		     is set, we are done.  */
 		  at_zv_p =
 		    MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p;
-		  if (!at_zv_p)
+		  if (!at_zv_p
+		      && w->cursor.hpos >= 0
+		      && (w->cursor.hpos
+			  < MATRIX_ROW_USED (w->current_matrix,
+					     w->cursor.vpos)))
 		    {
 		      struct glyph_row *candidate =
 			MATRIX_ROW (w->current_matrix, w->cursor.vpos);


BTW, is this code in try_window_reusing_current_matrix correct?

    struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
    struct glyph *end = glyph + row->used[TEXT_AREA];

It doesn't seem right for end to depend on hpos.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-15 16:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-13 19:28 bug#9495: 24.0.50; Segfault in try_cursor_movement Johan Bockgård
2011-09-14  5:22 ` Eli Zaretskii
2011-09-14 19:50   ` Johan Bockgård
2011-09-15  3:12     ` Leo
2011-09-15  4:41       ` Eli Zaretskii
2011-09-15 16:05     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.