Firefox got maniac
Update 2018-11-06: it was a fontconfig bug that is fixed in version 2.13.1-2. I can confirm that with this version all is back to normal, finally.
I don’t know what, I don’t know why, but Firefox behaves completely maniac on one of my computers. Opening simple tabs beats up 4 Web Content threads to nearly 100% CPU time, switching tabs the same.
By now I have:
- removed all of .mozilla
- started in –safe-mode
- disabled all extensions
- tried upstream provided Firefox instead of Debian’s
- made tripple flips while balancing three raw eggs on my nose
plus some more trials like removing locally installed fonts. But nothing has helped. Firefox is maniac. Opening a new tab with my Debian Q&A page sometimes, but not always, just shoots up the CPU usage as shown above. Yes, that are *4* Web Content all around/above 60%. This is all on an up-to-date Debian/sid.
Behavior is erratic. Often after suspend to ram and wake up it is getting worse. No idea what else I could do…
Anyone having an idea, please let me know!
Update 2018-10-04: For everyone interested, I am now suspecting a problem with the fontconfig library. The reasons why I come to this proposal is:
- the turning wheel on white background I experience often, I also see when new font packages are installed and fc-cache etc is updated
- another program (electron based) started to crash in libfontconfig with:
(gdb) bt #0 0x00007f416edf1dc0 in () at /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 #1 0x00007f416ede5ede in FcConfigSubstituteWithPat () at /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 #2 0x00007f416edf69fd in FcFontRenderPrepare () at /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 #3 0x00007f416edf6e84 in FcFontMatch () at /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
I hope I can actual show that this is the problem by finding a problematic font I have installed. I have lots of fonts in /usr/local, in particular CJK fonts that sometimes are a bit challenging.
Does about:performance tell you something interesting?
Thanks, didn’t know about that, but it does not show anything specific, in particular since loading this page also hangs.
It’s a long shot, but I would try launching Firefox with the last Debian Live CD, just to rule out some strange Hardware or BIOS misconfiguration or problem. Also, if you use Mesa, maybe downgrade it? Last I could think is something kernel or CPU microcode related.
I will try this at some point, though it is a bit a pain. Thanks for the suggestion.
about:performance might give some clues, if you’re lucky.
Also, how does OpenGL do in general on that machine? Pretty sure Firefox rendering uses OpenGL.
Thanks, didn’t know about about:performance, but it doesn’t show anything suspicious, in particular it doesn’t load fast enough.
Have the same issue since two, three weeks? Not sure which update borked it and didn’t have time to investigate. But I would guess it was around mid September. Firefox (62.0.2-1) hit unstable on 22. September which would fit. Besides other things, the changelog mentiones:
* js/src/jit/BaselineJIT.h: Disable baseline JIT when SSE2 is not supported at runtime. bz#1492064. Closes: #908396, #908449.
* gfx/2d/Swizzle.cpp: Use Swizzle fallback when SSE2 is not supported. bz#1492065. Closes: #877445.
My machine has SSE2, though.
I guess I’ll try 62.0.0 to circle the error.
Interesting, thanks. I have sse2 active at my CPUs, so it shouldn’t be a problem, though.
Any update on our site? I tried firefox 62.0.0 but without success, it has the same behaviour.
Not really. My current most convincing suspect is Source Code Pro font, which I often used. When it is active on some web page, not only mine, it seems the CPU is booming. But I’m currently too busy to debug this further due to the necessity to suppress web fonts etc.
As a hotfix, you can change how much threads Firefox uses in Preferences > Performance
Unticking the “Use recommended performance settings” box will let you change how many threads you are using.
Thanks, that is a good idea to keep rest of the system working!
For everyone interested, I am now suspecting a problem with the fontconfig library. The reasons why I come to this proposal is:
I hope I can actual show that this is the problem by finding a problematic font I have installed. I have lots of fonts in /usr/local, in particular CJK fonts that sometimes are a bit challenging.
Have you installed any fonts in WOFF/WOFF2 format in a fontconfig-aware directory?
Hi Fabian,
no not that I have found one in my local font section. For now I have disabled /etc/fonts/local.conf which registered most of my fonts in /usr/local/share/fonts, plus some from the TeX Live fonts. It seems that disabling that made Firefox behave much nicer. I will test it for another 1-2 days, and then slowly try to add fonts to find out which one was the culprit, if it was one if it.
Hmmm…. Since you mention font issues as the probable cause, I’m reminded of a problem that I have been having with GIMP on a Windows 10 system. On that particular system, GIMP crashes when DejaVuSans.ttf or DejaVuSans-Bold.ttf are installed, and reacts badly to DejaVuSans-Oblique.ttf and DejaVuSans-BoldOblique.ttf.
There must be something weird about these font files, since Microsoft Word also turn out to dislike them.
See https://gitlab.gnome.org/GNOME/gimp/issues/1366#note_257590 for details.
(Sorry for bringing up Windows, but this is a corporate computer that “must” run Windows. Obviously, I’m not sure that I’m of any help here, but it would at least be interesting to know whether or not these specific font files play any role in your issue as well.)
It turned out that it was a bug in fontconfig that removed .uuid files from empty directories that threw firefox as well as other programs into despair. With the upload of 2.13.1-2 of fontconfig this has been fixed and I can confirm that I don’t have problems anymore.