GNU bug report logs - #70385
Crash in note_fringe_highlight

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 14 Apr 2024 16:18:05 UTC

Severity: normal

Merged with 70419, 70420, 70427

Found in version 30.0.50

Full log


Message #70 received at 70385 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: bjorn.bidar <at> thaodan.de, juri <at> linkov.net, 70385 <at> debbugs.gnu.org,
 vekazanov <at> gmail.com
Subject: Re: bug#70385: Crash in note_fringe_highlight
Date: Mon, 15 Apr 2024 16:03:27 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: bjorn.bidar <at> thaodan.de,  vekazanov <at> gmail.com,  70385 <at> debbugs.gnu.org,
>   juri <at> linkov.net
> Date: Mon, 15 Apr 2024 19:57:44 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Any reason you didn't include w->window_end_valid in the condition,
> > like we do for mouse-highlight?
> 
> This wasn't necessary to fix the crash for me.
> 
> > I'd like in general to have the same conditions, to avoid having
> > people wonder what they miss when they read this code.
> 
> Your wish is my command... :-)
> 
> I suspect it might fix the Bjorn's crash also.  Bjorn, please try:
> 
> diff --git a/src/xdisp.c b/src/xdisp.c
> index d984c12d1aa..51f6b1efd69 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -35771,9 +35771,10 @@ 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)
> -      || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
> -						  vpos)))
> +  if ((window_outdated (w)
> +       || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
> +						   vpos)))
> +      && w->window_end_valid)

I think this should be

  if ((window_outdated (w)
       || !w->window_end_valid
       || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
						   vpos)))

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.




This bug report was last modified 1 year and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.