unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-29 0e39ad6fa5: Fix crash after X error
Date: Sat, 24 Dec 2022 10:30:41 +0200	[thread overview]
Message-ID: <83fsd55hla.fsf@gnu.org> (raw)

> diff --git a/src/xdisp.c b/src/xdisp.c
> index 06c8b7730c..4e5250486f 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -16838,6 +16838,13 @@ redisplay_internal (void)
>  		/* Only GC scrollbars when we redisplay the whole frame.  */
>  		= f->redisplay || !REDISPLAY_SOME_P ();
>  	      bool f_redisplay_flag = f->redisplay;
> +
> +	      /* The X error handler may have deleted that frame
> +		 before we went back to retry_frame.  This must come
> +		 before any accesses to f->terminal.  */
> +	      if (!FRAME_LIVE_P (f))
> +		continue;
> +
>  	      /* Mark all the scroll bars to be removed; we'll redeem
>  		 the ones we want when we redisplay their windows.  */
>  	      if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
> @@ -16845,7 +16852,6 @@ redisplay_internal (void)
>  
>  	      if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
>  		{
> -
>  		  /* Don't allow freeing images and faces for this
>  		     frame as long as the frame's update wasn't
>  		     completed.  This prevents crashes when some Lisp
> @@ -16861,10 +16867,6 @@ redisplay_internal (void)
>  	      else if (!REDISPLAY_SOME_P ())
>  		f->redisplay = true;
>  
> -	      /* The X error handler may have deleted that frame.  */
> -	      if (!FRAME_LIVE_P (f))
> -		continue;
> -
>  	      /* Any scroll bars which redisplay_windows should have
>  		 nuked should now go away.  */
>  	      if (gcscrollbars && FRAME_TERMINAL (f)->judge_scroll_bars_hook)

Any reason not to have this test in both places?  I don't want to make
unsafe changes on the release branch.



             reply	other threads:[~2022-12-24  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-24  8:30 Eli Zaretskii [this message]
2022-12-24  9:38 ` emacs-29 0e39ad6fa5: Fix crash after X error Po Lu

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=83fsd55hla.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.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).