]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid crashes in half-baked emacsclient frames
authorEli Zaretskii <eliz@gnu.org>
Fri, 7 Jun 2024 19:30:41 +0000 (22:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 8 Jun 2024 13:00:51 +0000 (15:00 +0200)
If a client connection comes in while we handle a Lisp error,
the new frame creation could signal an error before the new
frame is ready for display.
* src/xdisp.c (redisplay_internal): Don't redisplay windows on
frames that were not completely set up.  (Bug#71224)

(cherry picked from commit e99a821f978530b4c397f88de145ff7ba9d31040)

src/xdisp.c

index 4df76baf92bdac4b15a60235ba85a44b20063957..0148cd76ada7415eea64a5405a87bc0a59d6a3d1 100644 (file)
@@ -17360,10 +17360,13 @@ redisplay_internal (void)
                = 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
+             /* The X error handler may have deleted that frame before
+                we went back to retry_frame.  Or this could be a TTY
+                frame that is not completely made, in which case we
+                cannot safely redisplay its windows.  This must come
                 before any accesses to f->terminal.  */
-             if (!FRAME_LIVE_P (f))
+             if (!FRAME_LIVE_P (f)
+                 || (FRAME_TERMCAP_P (f) && !f->after_make_frame))
                continue;
 
              /* Mark all the scroll bars to be removed; we'll redeem