Bug #4248

Firefox menus and dialogs missing text

Added by Peter Bui almost 4 years ago. Updated 9 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected versions:
Security IDs:


All Firefox (38.0.1-r1) menus and dialogs (including popups and form fields) are missing text as shown below.

Strangely, the web pages themselves have text, but the user interface elements do not.

I have installed ttf-freefont, font-bitstream-100dpi, ttf-dejavu, ttf-liberation, and many more.

Other gtk applications (xfce4-terminal, pcmanfm, thunar) do not appear to have this problem.

firefox.png (28.8 KB) firefox.png Firefox Preferences Missing Text Peter Bui, 05/25/2015 05:10 AM
2015-08-10-011811_1024x768_scrot.png (61.3 KB) 2015-08-10-011811_1024x768_scrot.png Ryan Noblett, 08/09/2015 06:27 PM (950 Bytes) Jeff Pohlmeyer, 06/29/2016 08:49 PM (950 Bytes) Jeff Pohlmeyer, 06/29/2016 08:55 PM
musl-0ce946cf-79ca8609.diff (11.5 KB) musl-0ce946cf-79ca8609.diff Jeff Pohlmeyer, 06/30/2016 08:33 PM
firefox.jpg (261 KB) firefox.jpg Alexandros Couloumbis, 04/18/2017 10:53 AM

Related issues

Related to Alpine Linux - Bug #4247: Firefox Segfaults when opening about:configNew2015-05-25

Related to Alpine Linux - Bug #7186: firefox-52.0.2-r0/firefox-esr-dev-52.0.2-r0 i686 no screen outputNew2017-04-24

Has duplicate Alpine Linux - Bug #8976: Firefox-esr x86, no widgetsNew2018-06-08

Has duplicate Alpine Linux - Bug #7084: firefox-51.0-r2 i686 no screen outputNew2017-04-03


#1 Updated by Natanael Copa almost 4 years ago

  • Related to Bug #4247: Firefox Segfaults when opening about:config added

#2 Updated by Jacob Cousino over 3 years ago

I also have this issue on x86 Edge

Noticed a kind of a work-around that might also give some clues as to the problem

If you exit from xfce with firefox open, and check the box to save the session, then launch xfce again, it will automatically open firefox and the text and buttons will not be broken. However if you went to open another instance of firefox that instance will be broken

#3 Updated by Ryan Noblett over 3 years ago

I am also experiencing this issue on Alpine 3.2.2 and Firefox 38.1.1-r0 (latest at this time). I cannot test the suggested workaround as I'm using awesome instead of xfce. Restarting awesome does not affect it. No other applications have this problem.

#4 Updated by Jeff Pohlmeyer over 2 years ago

This is certainly not a proper fix, but I did manage to get a
usable firefox up and running. Here is what I did...

First, make sure you have launched firefox at least once so
it will create the required profile directory. Then close
firefox and tweak the "userChrome.css" and "prefs.js" as
described below.

% cd ~/.mozilla/firefox/*.default/
% mkdir chrome
% touch chrome/userChrome.css

Now edit the newly-created "userChrome.css" file and add these TWO lines:

@namespace url(;
* { font-size:12pt !important; }

Next, edit ~/.mozilla/firefox/*.default/prefs.js
(it should already exist) and add these FOUR lines
to the end of the file:

user_pref("font.default.x-western", "sans-serif");
user_pref("font.minimum-size.x-western", 16);
user_pref("font.size.fixed.x-western", 16);
user_pref("font.size.variable.x-western", 18);

That should fix the fonts, but the address bar is still not usable.
Installing a "complete" theme should fix that.

This one seems fairly sane:

If you can't enter the above URL in the address bar, you may need to launch
firefox from a terminal, giving the URL as a command-line argument. From
the web page, click the "Add to Firefox" button and follow the instructions
from there.

Interestingly, after editing "prefs.js" as above it seems to avoid the
bug #4247 "about:config" crash, so it looks like the "divide by zero"
could be the result of a zero-width font.

I am also attaching a script that will automate these fixes.
(Use at your own risk, of course)

#6 Updated by Jeff Pohlmeyer over 2 years ago

I did a "git bisect" of musl and I think maybe musl
commit 0ce946cf is what broke the fonts in firefox:

commit 0ce946cf808274c2d6e5419b139e130c8ad4bd30
Author: Szabolcs Nagy <>
Date:   Wed Oct 29 00:34:37 2014 +0100

    math: use the rounding idiom consistently

Attached is a diff of that commit, maybe somebody else can spot
a problem, but I might as well be reading /dev/urandom

#7 Updated by Jeff Pohlmeyer over 2 years ago

oops, that last diff I posted was reversed, sorry.

Anyway, I did some more testing and narrowed it down to
In the latest git, line 25 is:

y = x + toint - toint - x;

Change it back to the old version:

y = (double)(x + 0x1p52) - 0x1p52 - x;

And Firefox has fonts again.

The call to round() seems to come from
line 331:

sDPI = int32_t(round(gdk_screen_get_resolution(screen)));

With the good round(), sDPI gets set to 96.
With the bad round(), sDPI gets set to 1.

But when I try to get a small test program to show the same problem, the problem disappears --
it returns 96 either way.

#8 Updated by Natanael Copa over 2 years ago

Good job finding this! The problem is that firefox changes the precision:

This makes things go wrong when they later call libc's round().

EDIT: fix url to source code

#9 Updated by Jeff Pohlmeyer over 2 years ago

Thanks, ncopa. I was beginning to wonder if anybody was listening :-)

I posted a patch to the alpine-aports list that simply replaces round() with nearbyint() in gfxPlatformGtk::GetDPI() which seems to work. Does that make sense?

It also seems to fix #4247 but there is still some problem with the address bar layout.

#10 Updated by Alexandros Couloumbis about 2 years ago

this issue remains as of alpine-3.5 i386. is there a fix or a workaround available?

#11 Updated by Alexandros Couloumbis about 2 years ago

I apologize for speaking too soon and not paying proper attention to this ticket. Using the latest posted in this ticket deals with the issue. I am posting this through alpine-3.5-i386/firefox-esr

#12 Updated by Lucas F about 2 years ago

This is not 100% fixed. Open devtools and 3/4 of the text is missing. I ran the and it fixed most of it, but devtools are still broken. Again, on x86 platform. Also, image rendering of some type of image is broken. I would tell you which one but devtools are broken ^^

OK, that was a joke, I checked with a working machine and the affected images are PNG.

See the google logo on the right.

Confirmed on both 45.6.0-r0 and 45.7.0-r0.

#13 Updated by Alexandros Couloumbis almost 2 years ago

related with comment #9, the issue with the blurred resized images still remains and it's quite aggregating on i686 systems

attaching a related snapshot from a firefox-esr-45.8.0-r1

#14 Updated by Brian Becker 12 months ago

I played with a few of the preferences and have tracked down the blurred resized images, and found a potential workaround. Works for seamonkey (with a minimal patch get it to compile on ia32). Setting the image.downscale-during-decode.enabled to false makes images display properly. The effect is instant.

Would be helpful to know if this works on Firefox. If anyone needs Seamonkey patch for ia32 I could provide that as well.

#15 Updated by Natanael Copa 9 months ago

This is reported upstream:

I believe it is difficult to fix properly. They change the precision in the FPU which results in undefined behavior for any floating point operations. They are only "lucky" that it works on glibc.

#16 Updated by Natanael Copa 9 months ago

  • Has duplicate Bug #8976: Firefox-esr x86, no widgets added

#17 Updated by Natanael Copa 9 months ago

  • Related to Bug #7186: firefox-52.0.2-r0/firefox-esr-dev-52.0.2-r0 i686 no screen output added

#18 Updated by Natanael Copa 9 months ago

  • Has duplicate Bug #7084: firefox-51.0-r2 i686 no screen output added

Also available in: Atom PDF