unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andreas Hilboll <andreas.hilboll@posteo.de>
Cc: 37637@debbugs.gnu.org
Subject: bug#37637: 27.0.50; Segmentation fault when setting font face for new frames
Date: Tue, 08 Oct 2019 12:02:56 +0300	[thread overview]
Message-ID: <83pnj7y5hb.fsf@gnu.org> (raw)
In-Reply-To: <877e5gxocp.fsf@posteo.de> (message from Andreas Hilboll on Mon,  07 Oct 2019 23:00:38 +0200)

> 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));





  reply	other threads:[~2019-10-08  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-06 15:32 bug#37637: 27.0.50; Segmentation fault when setting font face for new frames Andreas Hilboll
2019-10-06 18:11 ` Eli Zaretskii
2019-10-07 21:00   ` Andreas Hilboll
2019-10-08  9:02     ` Eli Zaretskii [this message]
2019-10-08 12:56       ` Andreas Hilboll
2019-10-08 13:15         ` Eli Zaretskii

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=83pnj7y5hb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37637@debbugs.gnu.org \
    --cc=andreas.hilboll@posteo.de \
    /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).