From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#37786: 26.3; Emacs crashes when calling function to decode string Date: Tue, 05 Nov 2019 18:40:28 +0100 Message-ID: References: <80sgnsdn9a.fsf@felesatra.moe> <87zhi0knm5.fsf@gnus.org> <80wod21xu4.fsf@felesatra.moe> <80imol1qj9.fsf@felesatra.moe> <80d0ep4f7a.fsf@felesatra.moe> <805zkg3zyj.fsf@felesatra.moe> <801ruz4z8r.fsf@felesatra.moe> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="21882"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37786@debbugs.gnu.org To: Allen Li Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 05 18:41:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iS2pO-0005Yx-Dh for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Nov 2019 18:41:14 +0100 Original-Received: from localhost ([::1]:46906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS2pN-0007V1-6z for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Nov 2019 12:41:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45123) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS2pF-0007Tw-8c for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2019 12:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iS2pD-0008Dr-Uh for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2019 12:41:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iS2pD-0008Ce-Oh for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2019 12:41:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iS2pD-0004Fj-J4 for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2019 12:41:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Nov 2019 17:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37786 X-GNU-PR-Package: emacs Original-Received: via spool by 37786-submit@debbugs.gnu.org id=B37786.157297564116302 (code B ref 37786); Tue, 05 Nov 2019 17:41:03 +0000 Original-Received: (at 37786) by debbugs.gnu.org; 5 Nov 2019 17:40:41 +0000 Original-Received: from localhost ([127.0.0.1]:39028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2oq-0004Er-Dn for submit@debbugs.gnu.org; Tue, 05 Nov 2019 12:40:41 -0500 Original-Received: from mail-wm1-f43.google.com ([209.85.128.43]:53620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iS2on-0004EZ-Ox for 37786@debbugs.gnu.org; Tue, 05 Nov 2019 12:40:38 -0500 Original-Received: by mail-wm1-f43.google.com with SMTP id x4so214573wmi.3 for <37786@debbugs.gnu.org>; Tue, 05 Nov 2019 09:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=DUu6jsooMI+e5jd1Jk4MinDHs9S65jyLm2+uFdXnFy8=; b=aYfcdVcG+5QrtpyTpb4Q0tSvTMxq7gxHJKp3LOQhihQrk9bkV5NhxRTPFHUsFSv2Ke MmoXKhVWAYE9dMgEB+A29WnwyrI/si79wL4cXbms635zRdW+EY7MjvQPzuNPrG90DYW4 YQwfTDvAfB5tUYezWY7iAEME5jmh1deYsMcUIjyEEiDo2Cl1dwrJXHUvdrI9N5oEXtAH k+odSc/6S9/1QM5ZW8txJN8b+tcpxw96+ZA5m5MdZwMs/bfDL4xwGZvTb6EsOJT8/xlz Q8H/NP6DXKPI1BauhGbm7IZgaCL6T7nHyncfWNBjpWL95nsC7+Ora5s/EHxUIWPrtsa/ xCQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=DUu6jsooMI+e5jd1Jk4MinDHs9S65jyLm2+uFdXnFy8=; b=rK4F0CRB9mssX2TuUxNb1mlesfxNVVEDzay43eMbgzyz/ILCR+HZ1ZznlSkKXPYtgT eI5hmcr8LA2GvtxssWm185P9b6WK4TjC7XIL1lVwJGQ/azYbuoyxnu8S9Qo56mZRjpzJ TMouEq+3BUWcsrwy8JSHzy5RO5gyzYdK1KiO8ICCQ/T6v++MULmvZrRhfFy0JYbHNktg 74YKDWrEUwAVnTxtNp1Asplv1N7e14UQXWHt+t2uUlmkOZSFTPv4dQNd2tXbNebYhr/w xsVCvQFSSjF9Ve4VlcONbt9G+5QEh1UT2pPbhmi0coDdJFOrf9gA+FowWmqeYj3JkLiU 7YyQ== X-Gm-Message-State: APjAAAWl7VY5eAoFbegnl91K4WdF6Fhes6LrxCxyM79uhR/ZXWF7qjkH IDVLlkebXo4l7jEOqcrUCCTBQKXE X-Google-Smtp-Source: APXvYqxb983EKHiZ+67NDI0QzRK7ujSDdx7mQvMYlJRM97dMadHPt+a7BIP1kBfD7jyd/ltOyfA5pw== X-Received: by 2002:a1c:998f:: with SMTP id b137mr183577wme.104.1572975630309; Tue, 05 Nov 2019 09:40:30 -0800 (PST) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:c514:c07d:445b:e553]) by smtp.gmail.com with ESMTPSA id s21sm30621222wrb.31.2019.11.05.09.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 09:40:29 -0800 (PST) In-Reply-To: (Robert Pluim's message of "Sun, 27 Oct 2019 09:26:35 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170981 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Sun, 27 Oct 2019 09:26:35 +0100, Robert Pluim s= aid: >>>>> On Sat, 26 Oct 2019 02:44:52 -0700, Allen Li said: >>> Hmm. Could you try the following against emacs-26 and see if it fix= es >>> your crash? (the character will almost certainly end up displayed >>> wrong). This looks more like a fontconfig bug than anything else: t= he >>> pattern we've supplied to FcFontList explicitly says "don=CA=BCt gi= ve me >>> color fonts". Allen> Yep, this fixes the crash and I get the box with unicode codepoi= nt Allen> inside. I don't know anything about fontconfig, so I can't comm= ent on Allen> whether this is a fontconfig bug. Robert> Thanks for testing. I=CA=BCll have to write a standalone test c= ase against Robert> fontconfig before I can say whether it=CA=BCs a fontconfig bug = or not, in Robert> the meantime I=CA=BCll clean up the patch. I think it=CA=BCs a fontconfig bug, but I=CA=BCve received no response from= the fontconfig guys. Perhaps I need to use their new-fangled issue tracker thing rather than good old email. In any case, both Arch and Fedora 31 have fontconfig packages with this issue, so we need to paper^Wfix the issue our end. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Ignore-color-fonts-returned-from-FcFontList.patch >From aabd13bba282563410ef95764cad39f02ecb5d84 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Mon, 4 Nov 2019 17:44:57 +0100 Subject: [PATCH] Ignore color fonts returned from FcFontList To: emacs-devel@gnu.org * src/ftfont.c (ftfont_list): [HAVE_XFT && FC_COLOR]: Ask FcFontList to return FC_COLOR attribute. Check returned attribute for non-FcFalse, since some color fonts have a color attribute that's neither FcFalse nor FcTrue (Bug#37786). --- src/ftfont.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ftfont.c b/src/ftfont.c index 77a4cf5de5..b066f55a18 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -864,6 +864,9 @@ ftfont_list (struct frame *f, Lisp_Object spec) #endif /* FC_CAPABILITY */ #ifdef FC_FONTFORMAT FC_FONTFORMAT, +#endif +#if defined HAVE_XFT && defined FC_COLOR + FC_COLOR, #endif NULL); if (! objset) @@ -904,7 +907,19 @@ ftfont_list (struct frame *f, Lisp_Object spec) for (i = 0; i < fontset->nfont; i++) { Lisp_Object entity; - +#if defined HAVE_XFT && defined FC_COLOR + { + /* Some fonts, notably NotoColorEmoji, have an FC_COLOR value + that's neither FcTrue nor FcFalse, which means FcFontList + returns them even when it shouldn't really do so, so we + need to manually skip them here (Bug#37786). */ + FcBool b; + if (Vxft_ignore_color_fonts + && FcPatternGetBool (fontset->fonts[i], FC_COLOR, 0, &b) + == FcResultMatch && b != FcFalse) + continue; + } +#endif if (spacing >= 0) { int this; -- 2.19.1.816.gcd69ec8cde --=-=-=--