unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Johan Bockgård" <bojohan@gnu.org>
Cc: 9495@debbugs.gnu.org
Subject: bug#9495: 24.0.50; Segfault in try_cursor_movement
Date: Wed, 14 Sep 2011 01:22:21 -0400	[thread overview]
Message-ID: <E1R3hvR-0006AI-IC@fencepost.gnu.org> (raw)
In-Reply-To: <877h5ctf72.fsf@gnu.org> (message from Johan Bockgård on Tue, 13 Sep 2011 21:28:17 +0200)

> From: Johan Bockgård <bojohan@gnu.org>
> Date: Tue, 13 Sep 2011 21:28:17 +0200
> 
> 
> 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

Thanks.  But what is the value of `rv' at that point?

> 2011-09-13  Johan Bockgård  <bojohan@gnu.org>
> 
> 	* xdisp.c (try_cursor_movement): Check bounds of hpos.

That will prevent your particular crash, but I'm not sure it's correct
in all cases (like R2L lines and other atrocities).  Can you give a
recipe for reproducing this crash from "emacs -Q"?  I'd like to
investigate a bit more.  TIA.

> 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];

No, it's a bug.  I fixed it.  Thanks for spotting it.





  reply	other threads:[~2011-09-14  5:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1R3hvR-0006AI-IC@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=9495@debbugs.gnu.org \
    --cc=bojohan@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).