GNU bug report logs - #31316
Emacs hangs in `font_open_entity'

Previous Next

Package: emacs;

Reported by: Werner LEMBERG <wl <at> gnu.org>

Date: Mon, 30 Apr 2018 08:14:01 UTC

Severity: normal

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Werner LEMBERG <wl <at> gnu.org>
To: eliz <at> gnu.org
Cc: 31316 <at> debbugs.gnu.org
Subject: bug#31316: Emacs hangs in `font_open_entity'
Date: Tue, 08 May 2018 22:49:30 +0200 (CEST)
For completeness:

> Attached. It contains all breaks between loading the test file in
> GB18030 encoding and displaying something on screen.
> 
> This is still emacs bca6c434 (Apr 29).

... with the following local patches (which don't influence the
selection of fonts, still leading to the problematic `Emmentaler'
font).


    Werner


PS: Why doesn't produce the `pp' command (from emacs's `.gdbinit'
    file) any output in `gdb.txt' if activated with `set logging on'?


======================================================================


diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 4a7b754791..47f8c9ad3a 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -53,7 +53,7 @@
        ("ascii-0$" . ascii)
        ("gb2312.1980" . chinese-gb2312)
        ("gbk" . chinese-gbk)
-       ("gb18030" . (unicode . nil))
+       ("gb18030" . (gb18030 . unicode))
        ("jisx0208.1978" . japanese-jisx0208-1978)
        ("jisx0208" . japanese-jisx0208)
        ("jisx0201" . jisx0201)
diff --git a/src/font.c b/src/font.c
index ef3f92b594..daa6be00e6 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2901,7 +2901,9 @@ font_open_entity (struct frame *f, Lisp_Object entity, int pixel_size)
   for (psize = pixel_size; ; psize++)
     {
       font_object = driver_list->driver->open (f, entity, psize);
-      if (NILP (font_object))
+      if (NILP (font_object)
+         /* Avoid an infinite loop.  */
+         || psize > pixel_size + 100)
        return Qnil;
       font = XFONT_OBJECT (font_object);
       if (font->average_width > 0 && font->height > 0)




This bug report was last modified 5 years and 247 days ago.

Previous Next


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