[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#37637: 27.0.50; Segmentation fault when setting font face for new fr
From: |
Eli Zaretskii |
Subject: |
bug#37637: 27.0.50; Segmentation fault when setting font face for new frames |
Date: |
Tue, 08 Oct 2019 12:02:56 +0300 |
> From: Andreas Hilboll <andreas.hilboll@posteo.de>
> Date: Mon, 07 Oct 2019 23:00:38 +0200
>
> > Please run Emacs under a debugger and show the C-level and
> > Lisp-level
> > backtraces from the crash.
>
> Sure thing, here we go:
>
> (gdb) bt
> #0 0x00005555557c133d in terminate_due_to_signal (sig=6,
> backtrace_limit=2147483647) at emacs.c:371
> #1 0x00005555558de4c1 in die (msg=0x555555b781f0 "UNSIGNED_CMP
> (DEFAULT_FACE_ID, <, FRAME_FACE_CACHE (f)->used)",
> file=0x555555b7679d "font.c", line=3317) at alloc.c:7245
> #2 0x000055555596f31d in font_open_for_lface (f=0x555556a28e50,
> entity=XIL(0x5555592ec375), attrs=0x5555578f9618,
> spec=XIL(0x555559345925)) at font.c:3317
Thanks, please see if the patch below gives good results.
diff --git a/src/font.c b/src/font.c
index 935dd64..044c437 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3314,6 +3314,9 @@ font_open_for_lface (struct frame *f, Lisp_Object entity,
Lisp_Object *attrs, Li
pt = XFIXNUM (attrs[LFACE_HEIGHT_INDEX]);
else
{
+ /* We need the default face to be valid below. */
+ if (FRAME_FACE_CACHE (f)->used == 0)
+ recompute_basic_faces (f);
struct face *def = FACE_FROM_ID (f, DEFAULT_FACE_ID);
Lisp_Object height = def->lface[LFACE_HEIGHT_INDEX];
eassert (FIXNUMP (height));