unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Werner LEMBERG <wl@gnu.org>
Cc: 25945@debbugs.gnu.org
Subject: bug#25945: Emacs aborts while calling FT_Load_Glyph
Date: Fri, 03 Mar 2017 15:43:51 +0200	[thread overview]
Message-ID: <831suemq5k.fsf@gnu.org> (raw)
In-Reply-To: <20170303.113706.580485629830474327.wl@gnu.org> (message from Werner LEMBERG on Fri, 03 Mar 2017 11:37:06 +0100 (CET))

> Date: Fri, 03 Mar 2017 11:37:06 +0100 (CET)
> Cc: handa@gnu.org, 25945@debbugs.gnu.org
> From: Werner LEMBERG <wl@gnu.org>
> 
> >> > 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.





  reply	other threads:[~2017-03-03 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  7:04 bug#25945: Emacs aborts while calling FT_Load_Glyph Werner LEMBERG
2017-03-03  8:08 ` Eli Zaretskii
2017-03-03  8:32   ` Werner LEMBERG
2017-03-03  8:43     ` Eli Zaretskii
2017-03-03 10:37       ` Werner LEMBERG
2017-03-03 13:43         ` Eli Zaretskii [this message]
2017-03-04  5:39           ` Werner LEMBERG
2017-03-04  9:32             ` Eli Zaretskii
2017-03-11 19:08   ` Eli Zaretskii
2017-04-11 10:08 ` 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=831suemq5k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25945@debbugs.gnu.org \
    --cc=wl@gnu.org \
    /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).