Closed
Bug 1411931
Opened 8 years ago
Closed 8 years ago
Firefox 57.0b9 segfaults if started only with misc-fixed font available
Categories
(Core :: Graphics: Text, defect)
Tracking
()
RESOLVED
FIXED
mozilla58
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | fixed |
People
(Reporter: dvlasenk, Assigned: jfkthame)
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
|
437.86 KB,
application/octet-stream
|
Details | |
|
2.07 KB,
patch
|
lsalzman
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171019103055
Steps to reproduce:
I am running a Fedora Rawhide installation.
I have only one font installed, the standard font distributed with X.org X server: misc-fixed font.
To force all X applications to use only it, I do the following:
(1) edit /etc/fonts/fonts.conf
so that "<!-- Font directory list -->" section contains only path to my directory with fonts I chose, not the system directories. In my case, this section contains just:
<dir>/usr/app/Xfonts</dir>
(2) put desired fonts into subdirectories of /usr/app/Xfonts. In my case, I have these files there:
-rw-r--r-- 1 root root 974681 Apr 6 2009 misc/10x20.bdf
-rw-r--r-- 1 root root 94333 Jan 5 2006 misc/4x6.bdf
-rw-r--r-- 1 root root 194747 Jan 5 2006 misc/5x7.bdf
-rw-r--r-- 1 root root 154919 Jan 5 2006 misc/5x8.bdf
-rw-r--r-- 1 root root 184612 Jan 5 2006 misc/6x10.bdf
-rw-r--r-- 1 root root 549703 Jun 26 2008 misc/6x12.bdf
-rw-r--r-- 1 root root 159441 Jan 5 2006 misc/6x13B.bdf
-rw-r--r-- 1 root root 512118 Apr 6 2009 misc/6x13.bdf
-rw-r--r-- 1 root root 95801 Jan 5 2006 misc/6x13O.bdf
-rw-r--r-- 1 root root 144785 Jan 5 2006 misc/6x9.bdf
-rw-r--r-- 1 root root 124748 Jan 5 2006 misc/7x13B.bdf
-rw-r--r-- 1 root root 400761 Apr 21 2008 misc/7x13.bdf
-rw-r--r-- 1 root root 103390 Jan 5 2006 misc/7x13O.bdf
-rw-r--r-- 1 root root 128518 Jan 5 2006 misc/7x14B.bdf
-rw-r--r-- 1 root root 327838 Jan 5 2006 misc/7x14.bdf
-rw-r--r-- 1 root root 141768 Jan 5 2006 misc/8x13B.bdf
-rw-r--r-- 1 root root 459959 Jan 5 2006 misc/8x13.bdf
-rw-r--r-- 1 root root 160613 Jan 5 2006 misc/8x13O.bdf
-rw-r--r-- 1 root root 270622 Jan 5 2006 misc/9x15B.bdf
-rw-r--r-- 1 root root 765675 Apr 6 2009 misc/9x15.bdf
-rw-r--r-- 1 root root 133756 Jan 5 2006 misc/9x18B.bdf
-rw-r--r-- 1 root root 834998 Apr 6 2009 misc/9x18.bdf
-rw-r--r-- 1 root root 145955 Jan 5 2006 misc/clR6x12.bdf
(I will attach a tarball).
(3) rm -rf /var/cache/fontconfig
After this, all my X applications still work. Except Firefox. Earlier versions of Firefox refused to start outright, and I had to add one TTF font to that directory for it to work.
Firefox 57 got better: it does start! (NB: might need security.sandbox.content.level=2, depending on the chosen dir).
However, numbers are looking funny (they are in blue circles), and with "inspect element" I found out they are drawn using /usr/lib64/firefox/fonts/EmojiOneMozilla.ttf font.
I deleted that file, and Firefox started segfaulting, like older versions. Luckily, it says WHERE it crashes! -
$ firefox
Crash Annotation GraphicsCriticalError: |[C0][GFX1]: no fonts - init: 1 fonts: 2 loader: 0 (t=0.578138) [GFX1]: no fonts - init: 1 fonts: 2 loader: 0
[Child 19769, Main Thread] ###!!! ABORT: unable to find a usable font (sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","Ubuntu","Helvetica Neue"): file /builddir/build/BUILD/firefox-57.0b9/gfx/thebes/gfxTextRun.cpp, line 2092
[Child 19769, Main Thread] ###!!! ABORT: unable to find a usable font (sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","Ubuntu","Helvetica Neue"): file /builddir/build/BUILD/firefox-57.0b9/gfx/thebes/gfxTextRun.cpp, line 2092
Crash Annotation GraphicsCriticalError: |[0]CP+[GFX1]: no fonts - init: 1 fonts: 2 loader: 0 (t=1.14337) |[1][GFX1]: no fonts - init: 1 fonts: 2 loader: 0 (t=1.20146) [GFX1]: no fonts - init: 1 fonts: 2 loader: 0
[Parent 19703, Main Thread] ###!!! ABORT: unable to find a usable font (Fixed): file /builddir/build/BUILD/firefox-57.0b9/gfx/thebes/gfxTextRun.cpp, line 2092
[Parent 19703, Main Thread] ###!!! ABORT: unable to find a usable font (Fixed): file /builddir/build/BUILD/firefox-57.0b9/gfx/thebes/gfxTextRun.cpp, line 2092
Segmentation fault (core dumped)
Expected results:
Firefox should run fine with only misc-fixed font available on the system.
| Reporter | ||
Comment 1•8 years ago
|
||
| Reporter | ||
Comment 2•8 years ago
|
||
I assume the nature of the crash stems from the fact that most people, and most developers, do not test firefox in an environment with such an extremely limited set of fonts available.
Therefore some rare code paths which are supposed to fall back to some font are buggy and can erroneously fail to do so, but it's not caught in testing. There may be just a handful of them left to fix to make it work.
I hope that with my description, you can easily reproduce this failure.
Updated•8 years ago
|
Component: Untriaged → Graphics: Text
Product: Firefox → Core
Updated•8 years ago
|
Whiteboard: [gfx-noted]
| Assignee | ||
Comment 3•8 years ago
|
||
OK, I see what's happening here. We end up hitting gfxFontGroup::GetDefaultFont, because none of the fonts specified by CSS or prefs, etc., are available. It finds the (single) available font-family, which is fine; but then when we want to pick the best face from that family, it can fail if the requested size is too different from what is actually available. So then we end up with no usable font.
At this point, we should ignore the 20% tolerance on size matching, and just take whatever is present even if the size isn't a good match; any font, even a badly-scaled one, is better than no font at all.
| Assignee | ||
Comment 4•8 years ago
|
||
Attachment #8923881 -
Flags: review?(lsalzman)
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jfkthame
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Updated•8 years ago
|
Attachment #8923881 -
Flags: review?(lsalzman) → review+
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31676c81e8df
Ignore the font-size tolerance for bitmap fonts when matching font style in GetDefaultFont, as even a poor size match is better than no usable font. r=lsalzman
Comment 6•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•