unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Steven Allen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rpluim@gmail.com, 74902@debbugs.gnu.org
Subject: bug#74902: 31.0.50; Segfault when deleting frames
Date: Tue, 31 Dec 2024 08:31:04 -0800	[thread overview]
Message-ID: <877c7fg6gn.fsf@stebalien.com> (raw)
In-Reply-To: <86ldvzq8xa.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:
> Thanks.  I guess we also need a FRAME_LIVE_P test in
> gui_consider_frame_title?

I've attached a patch for that but note that it doesn't actually help in
this situation because the frame isn't deleted until:

https://git.savannah.gnu.org/cgit/emacs.git/tree/src/frame.c?h=2f1052d9b0de551dc3a463ed54e21c63517497ab#n2536

Whereas the crash happens here, 36 lines above:

https://git.savannah.gnu.org/cgit/emacs.git/tree/src/frame.c?h=2f1052d9b0de551dc3a463ed54e21c63517497ab#n2500


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Avoid-operating-on-dead-frames-when-updating-titles.patch --]
[-- Type: text/x-patch, Size: 1259 bytes --]

From 4f4907bf1657b5128dc045161272c360029c6f6a Mon Sep 17 00:00:00 2001
From: Steven Allen <steven@stebalien.com>
Date: Tue, 31 Dec 2024 07:48:47 -0800
Subject: [PATCH] Avoid operating on dead frames when updating titles

* src/xdisp.c (gui_consider_frame_title): Skip over dead/dying frames
when updating frame title.  (Bug#74902)
---
 src/xdisp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index ceb727d1135..d2ba8b10c80 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13858,9 +13858,10 @@ gui_consider_frame_title (Lisp_Object frame)
   struct frame *f = XFRAME (frame);
   Lisp_Object format_data;
 
-  if ((FRAME_WINDOW_P (f)
-       || FRAME_MINIBUF_ONLY_P (f)
-       || f->explicit_name)
+  if (FRAME_LIVE_P (f)
+      && (FRAME_WINDOW_P (f)
+	  || FRAME_MINIBUF_ONLY_P (f)
+	  || f->explicit_name)
       && !FRAME_TOOLTIP_P (f))
     {
       /* Do we have more than one visible frame on this X display?  */
@@ -13875,6 +13876,9 @@ gui_consider_frame_title (Lisp_Object frame)
 	{
 	  struct frame *tf = XFRAME (other_frame);
 
+	  if (!FRAME_LIVE_P (tf))
+	    continue;
+
 	  if (tf != f
 	      && FRAME_KBOARD (tf) == FRAME_KBOARD (f)
 	      && !FRAME_MINIBUF_ONLY_P (tf)
-- 
2.47.1


  reply	other threads:[~2024-12-31 16:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 22:01 bug#74902: 31.0.50; Segfault when deleting frames Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 15:50 ` Eli Zaretskii
2024-12-16 16:12   ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 17:20     ` Robert Pluim
2024-12-28 11:35       ` Eli Zaretskii
2024-12-28 23:23         ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-29  6:50           ` Eli Zaretskii
2024-12-31 16:31             ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-12-31 16:53       ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=877c7fg6gn.fsf@stebalien.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74902@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rpluim@gmail.com \
    --cc=steven@stebalien.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).