From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#9495: 24.0.50; Segfault in try_cursor_movement Date: Tue, 13 Sep 2011 21:28:17 +0200 Message-ID: <877h5ctf72.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1315942128 9163 80.91.229.12 (13 Sep 2011 19:28:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 19:28:48 +0000 (UTC) To: 9495@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 13 21:28:41 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3Yeu-00086I-NJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Sep 2011 21:28:40 +0200 Original-Received: from localhost ([::1]:35494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Yeu-0002YL-7y for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Sep 2011 15:28:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Yeq-0002Xr-Kp for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3Yeo-0005r1-IZ for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Yeo-0005qp-Fa for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R3Yj8-0000ZB-7w; Tue, 13 Sep 2011 15:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Sep 2011 19:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9495 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13159423812168 (code B ref -1); Tue, 13 Sep 2011 19:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Sep 2011 19:33:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3Yj5-0000Yu-LS for submit@debbugs.gnu.org; Tue, 13 Sep 2011 15:33:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3Yj3-0000Yn-6a for submit@debbugs.gnu.org; Tue, 13 Sep 2011 15:32:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3Yee-0005lg-Ks for submit@debbugs.gnu.org; Tue, 13 Sep 2011 15:28:28 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:48753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Yee-0005l4-B8 for submit@debbugs.gnu.org; Tue, 13 Sep 2011 15:28:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Yeb-00026f-Mf for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3Yea-0005iv-CD for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:21 -0400 Original-Received: from smtprelay-b11.telenor.se ([62.127.194.20]:33412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3YeZ-0005ih-V5 for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2011 15:28:20 -0400 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id BA09CC03A for ; Tue, 13 Sep 2011 21:28:18 +0200 (CEST) X-SMTPAUTH-B2: [bocjoh] X-SENDER-IP: [85.228.206.69] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmRvACmub05V5M5FPGdsb2JhbABChFWERpAKjkoLAQEBATczgXgFBC9YAgUhAhEBBBgBDAoth3mXc41gkXeBLIQxgREEnAiIWQ X-IronPort-AV: E=Sophos;i="4.68,375,1312149600"; d="scan'208";a="217468351" Original-Received: from c-45cee455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.206.69]) by ipb2.telenor.se with ESMTP; 13 Sep 2011 21:28:18 +0200 Original-Received: by muon.localdomain (Postfix, from userid 1000) id 9152048458B; Tue, 13 Sep 2011 21:28:17 +0200 (CEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 13 Sep 2011 15:33:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51109 Archived-At: 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=3D11) at emacs.c:358 #2 #3 0x0000000000465f3f in try_cursor_movement (window=3D20987605, startp=3D= ..., scroll_step=3D0x7fff5e400758) at xdisp.c:14639 xdisp.c:14639: (BUFFERP (g->object) && g->charpos =3D=3D PT) g is not a valid glyph here. (gdb) p MATRIX_ROW (w->current_matrix, w->cursor.vpos).used[TEXT_AREA] $3 =3D 80 (gdb) p w->cursor.hpos $4 =3D 80 2011-09-13 Johan Bockg=C3=A5rd * xdisp.c (try_cursor_movement): Check bounds of hpos. =3D=3D=3D 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 =3D MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; - if (!at_zv_p) + if (!at_zv_p + && w->cursor.hpos >=3D 0 + && (w->cursor.hpos + < MATRIX_ROW_USED (w->current_matrix, + w->cursor.vpos))) { struct glyph_row *candidate =3D MATRIX_ROW (w->current_matrix, w->cursor.vpos); BTW, is this code in try_window_reusing_current_matrix correct? struct glyph *glyph =3D row->glyphs[TEXT_AREA] + w->cursor.hpos; struct glyph *end =3D glyph + row->used[TEXT_AREA]; It doesn't seem right for end to depend on hpos.