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.

18 Responses

  1. Daniel Lange says:

    Does about:performance tell you something interesting?

  2. Paulo Thiago Santa says:

    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.

  3. Anthony DeRobertis says:

    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.

  4. Anonymous says:

    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.

      • Anonymous says:

        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.

  5. pollo says:

    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.

  6. 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.

  7. Fabian Greffrath says:

    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.

  8. luvr says:

    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.)

  9. 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.

  1. 2018/10/04

    […] I have had similar issues with #mozilla #firefox RAM usage-wise. They managed to make the browser worse (a lot more bloated) over time. I used to run it on my laptop with just 32MB of RAM. https://www.preining.info/blog/?p=7843 […]

Leave a Reply to Norbert Preining Cancel reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>