GNU bug report logs - #75725
SIGSEGV in emacs 30.0.93

Previous Next

Package: emacs;

Reported by: Florian Franzmann <bwlf <at> bandrate.org>

Date: Tue, 21 Jan 2025 08:37:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Florian Franzmann <bwlf <at> bandrate.org>
Cc: 75725 <at> debbugs.gnu.org
Subject: bug#75725: SIGSEGV in emacs 30.0.93
Date: Tue, 21 Jan 2025 14:31:00 +0200
> Date: Tue, 21 Jan 2025 09:15:30 +0100
> From: Florian Franzmann <bwlf <at> bandrate.org>
> 
> I'm experiencing a segmentation violation in emacs 30.0.93 when linked against GTK.
> The crash does not happen in the TUI version of emacs (which, obviously, is not
> linked against GTK).
> 
> Backtrace:
> 
> #0  normal_char_ascent_descent (font=0x0, c=c <at> entry=-1, ascent=ascent <at> entry=0x7fffffff2ad0, descent=descent <at> entry=0x7fffffff2ad4)
>     at xdisp.c:30407
> #1  0x000000000043b18b in normal_char_height (font=<optimized out>, c=c <at> entry=-1) at xdisp.c:30443
> #2  0x0000000000455cdf in handle_single_display_spec (it=it <at> entry=0x7fffffff3150, spec=<optimized out>, spec <at> entry=0x28266e3,
>     object=<optimized out>, object <at> entry=0x28dc604, overlay=overlay <at> entry=0x0, position=position <at> entry=0x7fffffff32b8,
>     bufpos=bufpos <at> entry=0, display_replaced=0, frame_window_p=true, enable_eval_p=true) at xdisp.c:6114
> #3  0x00000000004567de in handle_display_spec (it=it <at> entry=0x7fffffff3150, spec=<optimized out>, spec <at> entry=0x28266e3,
>     object=object <at> entry=0x28dc604, overlay=0x0, position=position <at> entry=0x7fffffff32b8, bufpos=bufpos <at> entry=0, frame_window_p=true)
>     at xdisp.c:5862

Thanks, I installed a trivial fix.  You may not like the results, but
at least Emacs should not crash.

I'm guessing the actual reason for this is that you have some
problematic setup of fonts, which causes some character on the mode
line to have no font for some reason.  So if loading the session which
previously crashed produces some weird display on the mode line, try
looking at your font/fontset setup to solve this.

(Of course, if Emacs still crashes after you update from Git or patch
it with the patch below, please report the backtrace from the crash,
maybe I missed something.)

Here's the patch which I installed on the emacs-30 branch:

diff --git a/src/xdisp.c b/src/xdisp.c
index 19ce5b7..f11a8aa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6111,7 +6111,9 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
 	    {
 	      struct face *face = FACE_FROM_ID (it->f, it->face_id);
 	      it->voffset = - (XFLOATINT (value)
-			       * (normal_char_height (face->font, -1)));
+			       * (face->font
+				  ? normal_char_height (face->font, -1)
+				  : FRAME_LINE_HEIGHT (it->f)));
 	    }
 #endif /* HAVE_WINDOW_SYSTEM */
 	}
@@ -32056,7 +32058,8 @@ produce_stretch_glyph (struct it *it)
   /* Compute height.  */
   if (FRAME_WINDOW_P (it->f))
     {
-      int default_height = normal_char_height (font, ' ');
+      int default_height =
+	font ? normal_char_height (font, ' ') : FRAME_LINE_HEIGHT (it->f);
 
       if ((prop = plist_get (plist, QCheight), !NILP (prop))
 	  && calc_pixel_width_or_height (&tem, it, prop, font, false, NULL))




This bug report was last modified 104 days ago.

Previous Next


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