From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25945: Emacs aborts while calling FT_Load_Glyph Date: Fri, 03 Mar 2017 15:43:51 +0200 Message-ID: <831suemq5k.fsf@gnu.org> References: <83bmtin5o5.fsf@gnu.org> <20170303.093217.2084474536954401081.wl@gnu.org> <834lzan41h.fsf@gnu.org> <20170303.113706.580485629830474327.wl@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1488548717 7153 195.159.176.226 (3 Mar 2017 13:45:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 13:45:17 +0000 (UTC) Cc: 25945@debbugs.gnu.org To: Werner LEMBERG Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 03 14:45:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjnWB-0001An-Pl for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 14:45:11 +0100 Original-Received: from localhost ([::1]:58166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnWG-0004H4-FF for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 08:45:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnW8-0004Ds-OF for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:45:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnW2-0003do-Tk for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:45:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjnW2-0003df-Q6 for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cjnW2-0005dh-Gs for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2017 13:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25945 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25945-submit@debbugs.gnu.org id=B25945.148854866521618 (code B ref 25945); Fri, 03 Mar 2017 13:45:02 +0000 Original-Received: (at 25945) by debbugs.gnu.org; 3 Mar 2017 13:44:25 +0000 Original-Received: from localhost ([127.0.0.1]:37536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjnVR-0005cc-7x for submit@debbugs.gnu.org; Fri, 03 Mar 2017 08:44:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjnVP-0005cP-VS for 25945@debbugs.gnu.org; Fri, 03 Mar 2017 08:44:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnVJ-0003Ib-UF for 25945@debbugs.gnu.org; Fri, 03 Mar 2017 08:44:18 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnVA-0003Cf-B1; Fri, 03 Mar 2017 08:44:08 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cjnV9-0006uC-Cb; Fri, 03 Mar 2017 08:44:07 -0500 In-reply-to: <20170303.113706.580485629830474327.wl@gnu.org> (message from Werner LEMBERG on Fri, 03 Mar 2017 11:37:06 +0100 (CET)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:130105 Archived-At: > Date: Fri, 03 Mar 2017 11:37:06 +0100 (CET) > Cc: handa@gnu.org, 25945@debbugs.gnu.org > From: Werner LEMBERG > > >> > I think it's too late for (b) when we discover this problem in > >> > ftfont_get_metrics. To do (b) we should have discovered this in > >> > ftfont_has_char, or thereabouts. > >> > >> Interesting. How comes that Emacs aborts right there? > > > > Sorry, I don't understand the question. If you are asking why > > there's a call to emacs_abort if FT_Load_Glyph fails, then I guess > > it''s because this is unexpected and we have no code capable of > > coping with such a calamity. > > I mean: There's more than one place where FT_Load_Glyph is called with > `FT_LOAD_DEFAULT'. You say that it is `too late'; this implies that > FT_Load_Glyph' has already been called earlier for a given glyph (with > `FT_LOAD_DEFAULT'), apparently without any fatal causes. No, it's "too late" because by the time ftfont_get_metrics is called, Emacs has already established that the particular character is supported by this font, and ftfont_get_metrics doesn't provide a way to tell the caller that the character is not supported. IOW, all the fallbacks that look for an alternative font don't assume (AFAIK) that a failure to display a character by some font can be discovered that late. > There's just a single `emacs_abort' related to the calls to > FT_Load_Glyph, and this looks strange to me – and not justified. It could be a problem, indeed. But it could also be that all of those other calls are either (a) after this particular one, so they will never be made if this one fails, or (b) they have a way of communicating a failure to their caller. IOW, one must analyze these calls in the context of the control flow when accessing a font for displaying a character, to understand whether this single call to emacs_abort is enough.