Bug 326509
| Summary: | [GTK] WebKitWebProcess spins at 100% CPU in fontconfig and never renders when WOFF fonts are installed in /usr/share/fonts/woff | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | bjorn.regnell |
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | bugs-noreply, fujii, mcatanzaro, mcrha |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=325185 | ||
bjorn.regnell
## Summary
With the Debian/Ubuntu package fonts-ebgaramond-extra installed (it installs .woff files in /usr/share/fonts/woff/ebgaramond/), every WebKitWebProcess spins at about 100% CPU and never renders anything. Observed in GNOME Evolution (Flatpak): message preview, message windows and the OAuth login dialog all stay blank, and right-click does nothing.
## Environment
Host: Ubuntu 24.04.5 LTS, kernel 6.8.0-146-generic, Intel integrated graphics, reproduced under both X11 and Wayland
Flatpak org.gnome.Evolution 3.62.0 on org.gnome.Platform//50
commit: 0bd5091046708e64bc882e8349877cfbae713f6a1e2d0487a5f10af820a2d792
Also reproduced with Evolution 3.60.2 (runtime 50) and 3.60.1 (runtime 49).
libwebkit2gtk-4.1.so.0.24.4 (from the runtime), Mesa 26.2.2 GL extension
fonts-ebgaramond-extra [version]; about 2,900 fonts installed in total (texlive-full)
## Analysis
strace on the spinning WebKitWebProcess: only about 1,100 syscalls in 5 s, so it is busy computing, not looping on syscalls.
perf top: most samples are in libfontconfig.so.1.16.0, the rest in libc and libwebkit2gtk (screenshot attached).
Not fixed by WEBKIT_DISABLE_DMABUF_RENDERER, WEBKIT_DISABLE_COMPOSITING_MODE, WEBKIT_SKIA_ENABLE_CPU_RENDERING, LIBGL_ALWAYS_SOFTWARE or GDK_BACKEND=x11.
Fixed by excluding only the WOFF directory in the app's fontconfig configuration:
<selectfont><rejectfont><glob>/run/host/fonts/woff/*</glob></rejectfont></selectfont>
Excluding the other host font directories (truetype/noto, type1, X11, cmap, cMap, fonts-go) did not help, while excluding woff alone fixes it.
## Steps to reproduce
Install fonts-ebgaramond-extra on the host.
Start any WebKitGTK-based Flatpak app on the GNOME 50 runtime (here Evolution) and display HTML content.
WebKitWebProcess goes to 100% CPU and the view stays blank.
## Expected
Installed WOFF fonts should be skipped or handled without an endless loop in font matching.
## Work-around in Gnome Evolution
Add this file:
```
$ cat ~/.var/app/org.gnome.Evolution/config/fontconfig/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<selectfont>
<rejectfont>
<glob>/run/host/fonts/woff/*</glob>
</rejectfont>
</selectfont>
</fontconfig>
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
bjorn.regnell
Also linked from there to here: https://gitlab.gnome.org/GNOME/evolution/-/work_items/3410
bjorn.regnell
Versions:
Evolution 3.62.0 (flatpak org.gnome.Evolution, stable) on runtime org.gnome.Platform//50, WebKitGTK 2.54.1 (libwebkit2gtk-4.1.so.0.24.4)
Also reproduced with Evolution 3.60.2 on runtime 50, and Evolution 3.60.1 on runtime 49 (older WebKitGTK)
Host: Ubuntu 24.04, kernel 6.8, Intel integrated graphics, X11 and Wayland
The trigger is the WOFF fonts from the Ubuntu package fonts-ebgaramond-extra in /usr/share/fonts/woff, which the Flatpak sees as /run/host/fonts/woff. Rejecting that folder in ~/.var/app/org.gnome.Evolution/config/fontconfig/fonts.conf fixes it. WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=326509
Milan Crha
Duplicate of bug #325185
Michael Catanzaro
*** This bug has been marked as a duplicate of bug 325185 ***