Issue 128583 - Crash at startup in fontconfig functions when certain fonts are installed
Summary: Crash at startup in fontconfig functions when certain fonts are installed
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: 4.1.15
Hardware: All Unix, all
: P5 (lowest) Critical (vote)
Target Milestone: 4.1.16
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2024-01-13 20:25 UTC by Arrigo Marchiori
Modified: 2024-01-14 16:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: Simple


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Arrigo Marchiori 2024-01-13 20:25:37 UTC
Bug reported on dev@ mailing list:
https://lists.apache.org/thread/3ogm6vzmbz9ntmm1cjgzpws0jzsrxmk6

When a certain font "Sitka.ttc" is present, AOO crashes at startup.
Comment 1 Arrigo Marchiori 2024-01-13 20:30:30 UTC
The crash is in function FcFontMatch(), called by method  FontCfgWrapper::addFontSet(FcSetName) in file main/vcl/unx/generic/fontmanager/fontconfig.cxx

According to the Fontconfig documentation [1], we should invoke FcDefaultSubstitute() first, and apparently we do not.

Adding that invocation seems to fix the problem in my own test case.

1: https://www.freedesktop.org/software/fontconfig/fontconfig-devel/fcfontmatch.html
Comment 2 Arrigo Marchiori 2024-01-14 16:53:10 UTC
Fixed with commit 9e383899f55d91dcbf240aac96faa852c30bbdbd to trunk.

Cherry-picked into AOO41X with commit 96cc864ad79ef0ed2b9769f074673a55e4056b44.

Cherry-picked into AOO42X with commit a0ea24c5c107bd6c1ce8cd77d6a0f2c7066cdec8.