Inkscape should not crash due to invalid fontconfig configuration

Bug #1716516 reported by Patrick Storz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Patrick Storz

Bug Description

Inkscape currently crashes if the fontconfig configuration is invalid.

Quickest way to reproduce:
- FONTCONFIG_FILE=invalid ./inkscape

This tells fontconfig to use "invalid" instead of the default "fonts.conf" and makes Inkscape immediately crash badly (see attached log).

Reproduces in current builds of master as well as 0.92.x branch; tested on Windows 10.

Tags: fonts
Revision history for this message
Patrick Storz (ede123) wrote :
description: updated
Revision history for this message
su_v (suv-lp) wrote :

Reported earlier in
* Bug #1546219 “Crash on launch after install with Homebrew”
  https://bugs.launchpad.net/inkscape/+bug/1546219
(see comment 4)

Revision history for this message
Patrick Storz (ede123) wrote :

Yes, there are in fact a lot more reports of Inkscape crashing due to this issue.

While those are typically packaging issues (like the one you linked) or due to conflicting software (like bug #1662293, bug #1697681 and bug #1709729) the intention of this bug is to acknowledge that Inkscape does not handle this case gracefully and should do a better job at handling the situation (and probably also at informing the user).

While we could close most of these as invalid for the Inkscape project I think the frequency of those bugs (and the fact that they are often hard to debug) warrant an improvement in Inkscape itself.

Revision history for this message
Patrick Storz (ede123) wrote :

Fix committed to master in
https://gitlab.com/inkscape/inkscape/compare/9d04be759628dc9b743b9a8c0f12aec16a9090a8...74d871992d7641101f8c26e934b96ae72d851c93

Inkscape won't crash anymore due to an invalid/missing fontconfig configuration.

The reason for the crash was that fontconfig could not provide a single fallback font in this case (as invalid fontconfig = no font faces available at all) and Inkscape did not handle this properly (it always expected at least one fallback font to be available).

Obviously one will not be able to create any text in this situation, but aside from that all UI functionality seems to be available.

The patch also adds debug output that looks as follows in the scenario described above:
** (inkscape.exe:7684): CRITICAL **: Could not load any face for font 'sans-serif 512'.

(let's see if Google does it's job ;-) )

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: nobody → Eduard Braun (eduard-braun2)
milestone: none → 0.93
tags: added: backport-proposed
Revision history for this message
Patrick Storz (ede123) wrote :
tags: removed: backport-proposed
Changed in inkscape:
milestone: 0.93 → 0.92.3
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.