Bug 132424 - Assertion failure when opening a document in LOOL (w certain fonts installed)
Summary: Assertion failure when opening a document in LOOL (w certain fonts installed)
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:7.0.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
Reported: 2020-04-26 02:02 UTC by Aron Budea
Modified: 2020-04-27 00:47 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

Backtrace (8.11 KB, text/plain)
2020-04-26 02:02 UTC, Aron Budea
Backtrace w thread apply all (10.89 KB, text/plain)
2020-04-26 14:56 UTC, Aron Budea

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2020-04-26 02:02:27 UTC
Created attachment 159945 [details]

The following requires a debug LO build to trigger.
Not sure if there's any other prerequisite, the assert seems to indicate some kind of font fallback handling problem (not related to the repro, since that uses Liberation Serif font).

- Build LOOL, and open the sample hello-world.odt in the browser with the URL given on the console.
=> Repeated crashes (since LOOL tries to reload the document).

The console shows the following assert:
"vcl/unx/generic/gdi/freetypetextrender.cxx:166: virtual std::unique_ptr<GenericSalLayout> FreeTypeTextRenderImpl::GetTextLayout(int): Assertion `mpFreetypeFont[nFallbackLevel]' failed."

Attaching backtrace. The backtrace indicates it's triggered when populating the font name box with the rendered name of the font when rendering headless. This could perhaps be reproduced purely with core in some way. This font name box and its pre-rendered contents are never shown in LOOL, btw.

This is a recent regression, bisected to the following commit. Adding CC: to Caolán McNamara.
author		Caolán McNamara <caolanm@redhat.com>	2020-04-07 12:21:47 +0100
committer	Caolán McNamara <caolanm@redhat.com>	2020-04-21 10:19:41 +0200

weld FontNameBox
Comment 1 Caolán McNamara 2020-04-26 13:40:13 UTC
could you get a

thread apply all backtrace

set of backtraces, I wonder if there are other threads involved
Comment 2 Aron Budea 2020-04-26 14:56:48 UTC
Created attachment 159961 [details]
Backtrace w thread apply all

It doesn't seem so. Attaching the backtrace.
Comment 3 Aron Budea 2020-04-26 17:02:51 UTC
The assert seems to be tied to specific fonts, disabling the following fonts in FontManager makes it go away for me: Fira Mono, Fira Sans, Optima, TeX Gyre *, Vegur.
Comment 4 Caolán McNamara 2020-04-26 18:51:51 UTC
ah!, it then might not actually be a true regression of the identified commit. The previews are generated for all fonts in an idle now in advance. So it possible that versions prior to that commit also asserted on visiting those fontnames in the dropdown. That said, if lool is not using the previews then its presumably wasteful to generate them.
Comment 5 Commit Notification 2020-04-26 20:01:34 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":


tdf#132424 don't generate font previews in advance for lool

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 6 Aron Budea 2020-04-26 23:11:37 UTC
Since now it doesn't crash with an assert on startup, I'm marking this fixed, and opening a new bug report with updated repro steps.
Thanks for the fix, Caolán!