Description of problem: Opening a mis-typed attachment in bugzilla makes firefox spin its wheels for multiple minutes trying to open fonts Version-Release number of selected component (if applicable): 1.0.1-2 How reproducible: Every time. Steps to Reproduce: 1. Open https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=109916&action=view Actual results: Churns for multiple minutes, with stuff like: open("/usr/X11R6/lib/X11/fonts/Type1/l048016t.pfa", O_RDONLY) = 37 open("/usr/X11R6/lib/X11/fonts/Type1/l048013t.pfa", O_RDONLY) = 37 open("/usr/X11R6/lib/X11/fonts/Type1/l048016t.pfa", O_RDONLY) = 37 open("/usr/lib/firefox-1.0.1/components/caps.xpt", O_RDONLY|O_LARGEFILE) = 37 open("/usr/share/fonts/bitmap-fonts/6x13.pcf", O_RDONLY) = 38 open("/usr/share/fonts/monotype/Cumbwr__.ttf", O_RDONLY) = 38 open("/usr/share/fonts/zh_TW/TrueType/bsmi00lp.ttf", O_RDONLY) = 38 open("/usr/share/fonts/hebrew/MiriamMonoCLM-Book.pfa", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/X11R6/lib/X11/fonts/OTF/SyrCOMAdiabene.otf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/default/ghostscript/n022003l.pfb", O_RDONLY) = 38 open("/usr/share/fonts/monotype/Cumbwr__.ttf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/9x15.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/X11R6/lib/X11/fonts/OTF/SyrCOMAdiabene.otf", O_RDONLY) = 38 open("/usr/share/fonts/monotype/Cumbwr__.ttf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x13.pcf", O_RDONLY) = 38 open("/usr/share/fonts/default/ghostscript/n022003l.pfb", O_RDONLY) = 38 open("/usr/X11R6/lib/X11/fonts/OTF/SyrCOMAdiabene.otf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x13.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/X11R6/lib/X11/fonts/OTF/SyrCOMAdiabene.otf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/share/fonts/hebrew/MiriamMonoCLM-Book.pfa", O_RDONLY) = 38 open("/usr/share/fonts/default/ghostscript/n022003l.pfb", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/zh_TW/TrueType/bsmi00lp.ttf", O_RDONLY) = 38 open("/usr/share/fonts/arabic/KacstQura.ttf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/lutRS12.pcf", O_RDONLY) = 38 open("/usr/share/fonts/monotype/Cumbwr__.ttf", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/6x13.pcf", O_RDONLY) = 38 open("/usr/share/fonts/hebrew/MiriamMonoCLM-Book.pfa", O_RDONLY) = 38 open("/usr/share/fonts/bitmap-fonts/10x20.pcf", O_RDONLY) = 38 open("/usr/share/fonts/arabic/KacstQura.ttf", O_RDONLY) = 38 open("/usr/share/fonts/japanese/TrueType/kochi-gothic-subst.ttf", O_RDONLY) = 38 Expected results: Not that. Additional info: Running with MOZ_DISABLE_PANGO=1 fixes it.
Of note, after opening that attachment a couple of times, firefox's memory usage is now at: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13367 notting 16 0 416m 344m 18m S 0.0 22.7 8:15.73 firefox-bin even after closing the open tabs.
As far as I can tell, the Pango/Xft part of it is behaving as expected ... FireFox is asking Pango to render characters switching between more fonts than the size of the Xft cache (5 files)
Indeed, if you attach to the running firefox process and do (gdb) set XftMaxFreeTypeFiles = 128 Then it will finish rendering a page after a minute or so. I really don't think FireFox should try to display a page as UTF-8 when it doesn't come remotely close to validating as UTF-8
So what's happening here? Is it just wandering all over all fonts on the system looking for a matching glyph?
Yes, AFAICT (and if I'm understanding Owen right.)
I wonder if it's looking for the same character or many different characters. i.e. should pango be caching the miss cases.
It's not Pango it's Xft ... Xft is being asked to deal with more fonts than it caches. There's nothing Pango can do (except for caching all metrics *again* on top of Xft doing it, which would be a waste)
Cannot reproduce on Fedora Core 6 (package firefox-1.5.0.10-5.fc6.x86_64), but I am afraid it is fully reproducable on RHEL4 (running in Xen guest, package firefox-1.5.0.10-0.1.el4.i386). When running firefox to the above mentioned attachemnt (hopefully no-one will fix that MIME identification on that attachment) through strace on FC6, this is what I get: [matej@hubmaier ~]$ strace -f -o firefox-strace.txt firefox [matej@hubmaier ~]$ grep font firefox-strace.txt | wc -l 136 [matej@hubmaier ~]$ However, when I run the same on RHEL4, I get this: [matej@localhost ~]$ strace -f -o firefox-strace.txt firefox [matej@localhost ~]$ grep font firefox-strace.txt | wc -l 21568 [matej@localhost ~]$ I am not sure to which component/distro I should assign this -- obviously it isn't Rawhide anymore. Should I make it into RHEL4 bug?
With MOZ_DISABLE_PANGO=1 I get 394 on RHEL4.
Made a clone to new RHEL-4 bug 239549 and closing this one.