unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: bjorn.bidar@thaodan.de, juri@linkov.net, 70385@debbugs.gnu.org,
	vekazanov@gmail.com
Subject: bug#70385: Crash in note_fringe_highlight
Date: Mon, 15 Apr 2024 17:39:03 +0300	[thread overview]
Message-ID: <864jc2lmgo.fsf@gnu.org> (raw)
In-Reply-To: <87y19ezq14.fsf@yahoo.com> (message from Po Lu on Mon, 15 Apr 2024 21:58:15 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: bjorn.bidar@thaodan.de,  vekazanov@gmail.com,  70385@debbugs.gnu.org,
>   juri@linkov.net
> Date: Mon, 15 Apr 2024 21:58:15 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I think this should be
> >
> >   if ((window_outdated (w)
> >        || !w->window_end_valid
> >        || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
> > 						   vpos)))
> 
> Yes, sorry.
> 
> > I'm not sure it will help, because it seems the segfault happens in
> > the MATRIX_ROW_DISPLAYS_TEXT_P macro.  So I think we are somehow
> > dealing with w->current_matrix whose 'nrows' is too small.  The
> > mouse-highlight code detects that case in x_y_to_hpos_vpos.
> 
> Right.  What about this?
> 
> diff --git a/src/xdisp.c b/src/xdisp.c
> index d984c12d1aa..dcecc2b09d4 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -35772,6 +35772,7 @@ note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y,
>    /* Don't access the TEXT_AREA of a row that does not display text, or
>       when the window is outdated.  (bug#70385) */
>    if (window_outdated (w)
> +      || (vpos >= w->current_matrix->nrows)
>        || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
>  						  vpos)))
>      return;
> 
> It's the same test x_y_to_hpos_vpos applies to decide whether to punt
> and return NULL.

Yes, LGTM.  Let's see if it prevents the crashes.





  reply	other threads:[~2024-04-15 14:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14 16:10 bug#70385: Crash in note_fringe_highlight Juri Linkov
2024-04-14 16:40 ` Eli Zaretskii
2024-04-14 16:41   ` Vladimir Kazanov
2024-04-15 16:39   ` Juri Linkov
2024-04-18 11:08     ` Eli Zaretskii
2024-04-18 17:10       ` Juri Linkov
2024-04-18 17:55         ` Eli Zaretskii
2024-04-14 16:40 ` Vladimir Kazanov
2024-04-14 20:13   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <87zftv7leb.fsf@>
2024-04-14 20:22     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 20:22     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <87edb73d9u.fsf@>
2024-04-15  1:32     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15  6:29       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15  6:29       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15  6:31       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]       ` <87bk6b16ii.fsf@>
2024-04-15  6:49         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 11:06           ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]           ` <661d0a70.0c0a0220.5de8.ce32SMTPIN_ADDED_BROKEN@mx.google.com>
2024-04-15 11:09             ` Vladimir Kazanov
     [not found]           ` <875xwiubq5.fsf@>
2024-04-15 11:26             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 12:55               ` Eli Zaretskii
2024-04-18 11:06             ` Eli Zaretskii
2024-04-18 14:34               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]               ` <87edb2buyu.fsf@>
2024-04-18 14:48                 ` Eli Zaretskii
2024-04-15 11:30       ` Eli Zaretskii
2024-04-15 11:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 13:03           ` Eli Zaretskii
2024-04-15 13:58             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 14:39               ` Eli Zaretskii [this message]
2024-04-15 17:04               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 17:04               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]               ` <87ttk2sgl9.fsf@>
2024-04-15 18:23                 ` Eli Zaretskii
2024-04-15 19:20                   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                   ` <87mspuph44.fsf@>
2024-04-16  6:52                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-16 10:56                       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15  6:49   ` Juri Linkov
2024-04-15  8:22     ` Vladimir Kazanov
2024-04-15 11:55       ` 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=864jc2lmgo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70385@debbugs.gnu.org \
    --cc=bjorn.bidar@thaodan.de \
    --cc=juri@linkov.net \
    --cc=luangruo@yahoo.com \
    --cc=vekazanov@gmail.com \
    /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).