Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 454252

Summary: www-client/firefox, mail-client/thunderbird, www-client/seamonkey: font corruption
Product: Gentoo Linux Reporter: Matthias Dahl <ua_gentoo_bugzilla>
Component: Current packagesAssignee: Mozilla Gentoo Team <mozilla>
Status: RESOLVED OBSOLETE    
Severity: normal CC: bas, dark.shadow, josef64, poncho, redneb, serge, yaron.tausky, zlg
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: firefox @ h-online.com: corrupted
firefox @ h-online.com: normal
firefox @ slashdot.org: corrupted
firefox @ slashdot.org: normal
thunderbird: corrupted
thunderbird: normal

Description Matthias Dahl 2013-01-27 09:58:19 UTC
Ever since sometime Q4/2012, I've been fighting with font corruption in firefox and thunderbird (see attached pictures). Unfortunately I had no time until this weekend to further localize what's causing this.

THE PROBLEM(S)
==============
Surfing the net with firefox, it happens quite often that one to several words or even several lines are corrupted. They look like a copy of the same area has been pasted over it but with a few pixel offset. Forcing a redraw will fix it. You can either click on the desktop and back into the window (focus), highlight/mark the affected area, close/open the window, ... etc.

In thunderbird, writing a mail and scrolling up or down, you usually end up with corrupted words. Fixing the corruption is the same as with firefox above, except for clicking on the desktop and back into the window (focus).

OBSERVATIONS
============

(1) This is absolutely limited to the non-bin packages. Taking the compiled releases from mozilla.org (through the appropriate ebuilds naturally), the bugs are not reproducible. Most likely since they do not use the system cairo.

(2) Disabling the jemalloc patchset directly in the ebuild, has no affect.

(3) This is _not_ caused by the nvidia blob. I tried with the nvidia driver 313.08 as well as nouveau 1.0.6, both show the same symptoms.

(4) Downgrading from pixman-0.28.2 to 0.26.2 (and thus recompiling cairo, firefox and thunderbird due to the API changes), does not fix it as well.

(5) Using either cairo 1.12.10, 1.10.2-r3 or current master (as of today) makes no difference at all.

(6) Disabling pango (via MOZ_DISABLE_PANGO=1) has not effect on this.

(7) Using a clean firefox profile has no affect.

(8) I use oxygen-gtk/3 which I uninstalled for test purposes: no affect.

(9) I use KDE 4.10-rc3, testing in XFCE with a clean slate, has no affect.

(10) freetype: disabling the freetype infinality patchset, uninstalling croscorefonts, w/ or w/o auto-hinter... no affect.

Reproducible: Always




Portage 2.2.0_alpha161 (default/linux/amd64/10.0/desktop, gcc-4.7.2, glibc-2.16.0, 3.7.4 x86_64)
=================================================================
System uname: Linux-3.7.4-x86_64-Intel-R-_Core-TM-_i7_CPU_860_@_2.80GHz-with-gentoo-2.2
KiB Mem:     8162792 total,    382316 free
KiB Swap:    4000060 total,   4000060 free
Timestamp of tree: Sun, 27 Jan 2013 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p42
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2::kde
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo local-crossdev java-overlay fordfrog DuPol aluco qt toolchain vmware science x11 graaff multimedia mozilla sabayon prometheanfire kde local_ebuilds
ACCEPT_KEYWORDS="amd64 ~amd64 ~amd64-linux"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 sun-bcla-java-vm skype-eula googleearth AdobeFlash-10 AdobeFlash-10.1 Oracle-BCLA-JavaSE Intel-SDP AdobeFlash-10.3 skype-4.0.0.7-copyright"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"                                                                                                                                                                                                              
FFLAGS="-O2 -pipe"                                                                                                                                                                                                                           
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://de-mirror.org/distro/gentoo/"                                                                                     
LANG="en_US.utf8"                                                                                                                                                                                                                            
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,-z,combreloc -Wl,-z,now"                                                                                                                                                                        
MAKEOPTS="-j5"                                                                                                                                                                                                                               
PKGDIR="/usr/portage/packages"                                                                                                                                                                                                               
PORTAGE_CONFIGROOT="/"                                                                                                                                                                                                                       
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"                              
PORTAGE_TMPDIR="/var/tmp"                                                                                                                                                                                                                    
PORTDIR="/usr/portage"                                                                                                                                                                                                                       
PORTDIR_OVERLAY="/usr/local/portage-overlays/local.crossdev /var/lib/layman/java-overlay /var/lib/layman/fordfrog /var/lib/layman/DuPol /var/lib/layman/aluco /var/lib/layman/qt /var/lib/layman/toolchain /var/lib/layman/vmware /var/lib/layman/science /var/lib/layman/x11 /var/lib/layman/graaff /var/lib/layman/multimedia /var/lib/layman/mozilla /var/lib/layman/sabayon /var/lib/layman/prometheanfire /var/lib/layman/kde /usr/local/portage-overlays/local"                     
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"                                                                                                                                                                                        
USE="16bit 64bit X a52 aac aacplus acl acpi acpi4linux activefilter additions aiglx aim aio alsa amarok amd64 amr animgif ansi ao aotuv apm apng archive artworkextra asf async athena audiofile autotools bash-completion beepmp berkdb bigpatch bineditor blender-game bluetooth bluray bolddiag bonobo branding browserplugin bs2b bzip2 bzlib c++0x cairo caps cdaudio cdb cdda cddb cdinstall cdio cdparanoia cdr cdrom chardet chdir chm chroot cisco clanJavaScript clanVoice cli clisp clucene clutter cmake codecs consolekit contrib coverage cpufreq cracklib crypt css cups curl curlwrappers custom-cflags custom-optimization cutterlimit cutterqueue cvs cxx d daap dbus dconf de_tvtoday declarative detex device-mapper devil dga dhcp dio dirac distribution divx djbfft dmi dnd doc dolby-record-switch dolbyinrec dpms dri dts dvb dvbplayer dvbsetup dvd dvdarchive dvdnav dvdr dvdread dvi2tty dvlfriendlyfnames dvlrecscriptaddon dvlvidprefer ebook editor edl emboss emoticon enca encode equalizer erandom evo2 exif expat ext-png ext-zlib extensions extra extraengine extrafilters extras faad fame ffmpeg fftw fits flac flash fmod fontconfig foomaticdb fortran fpx freetype frei0r ftp fts3 fuse games gb gcj gd gd-external gdbm gif gimp gimpprint git glade gles glibc-omitfp glitz glsa glut gmedia gmp gnutls go gold gpm graphics graphviz gs gstreamer gtk gtk3 gtkhtml gtkstyle h264 hbci hddtemp hdri hires-icons htmlhandbook hybrid-auth icecast iconv icq icu idea idn imap imlib imlib2 infinality inherit-graph inkjar inotify inquisitio iplayer ipv6 irc irda ithreads j2ee jabber java java6 javacomm javamail javascript jce jikes jpeg jpeg2k jumpplay kde kde4 kdehiddenvisibility keyscrub kickoff kipi kpathsea kqemu kvm lame lastfm latex lcms libdsk libgcrypt libnotify libsamplerate libssh2 libv4l2 libwww liemikuutio linuxthreads-tls live lm_sensors lua lvm lxde lzma lzo macvtap mad maildir mainmenuhooks map mapeditor maps math matroska md5sum metis mikmod mime ming minizip mixer mms mmx mmxext mng modplug modules monkey moonlight mozbranding mozdevelop mozilla moznocompose moznoirc moznomail mozsvg mp2 mp3 mp4 mp4live mpeg mpeg4 mpi mplayer mudflap multilib multimedia multiuser music mythtv nat native ncurses network new-login newspr nls no-old-linux noamazon nova nptl nsplugin nvidia offensive ofx ogg oggvorbis omega openal openexr opengl openmp openssl operanom2 optimized-qmake oscar osdmaxitems osmesa pam pango pcap pch pcntl pcre pdf pdfimport perforce pertty pgo phyp physfs pink player playlist png pnm policykit portage postproc povray ppds projectm projectx pstricks publishers pulseaudio python python3 qa qalculate qemu qml qt qt-faststart qt3support qt4 quotes rar rc5 readline realmedia realtime recode remix rhythmbox rle romio rss rtc rtmp rtsp samba sasl sbig schroedinger science sdl semantic-desktop session setup setup-plugin sftplogging shout shutdown_rewrite silc skype slp smbclient smime smp sms sndfile solver sortrecords sounds sourceview sox spamassassin speedo speex spell sqlite sse sse2 sse3 sse4 sse4_1 ssl ssse3 startup-notification stencil-buffer stream subp subtitles subversion suhosin svg svgz switchtimer syslog taglib tcpd templates tetex tex4ht tga themes theora threads threadsafe thumbnail tidy tiff timerinfo timidity toolkit-scroll-bars tools transcode transparency truetype twolame type1 udev udisks unicode upower urandom usb utf8 utils uudeview v4l v4l2 vaapi valgrind validinput vcd vcdimager vdpau video videos visibility visualization vlm voice volctrl vorbis vorbis-psy vpx wareagleicon wavpack webkit win32 win64 wininst wma wma123 wmf wxwidgets x264 xa xanim xatrix xcb xchatdccserver xcomposite xface xfce xforms xft xine xml xml2 xmlrpc xrandr xscreensaver xslt xulrunner xv xvid xvmc yahoo youtube yv12 zip zlib zvbi" ALSA_CARDS="hda-intel virtuoso" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" LIRC_DEVICES="devinput" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Matthias Dahl 2013-01-27 09:59:13 UTC
Created attachment 336980 [details]
firefox @ h-online.com: corrupted
Comment 2 Matthias Dahl 2013-01-27 09:59:33 UTC
Created attachment 336982 [details]
firefox @ h-online.com: normal
Comment 3 Matthias Dahl 2013-01-27 09:59:52 UTC
Created attachment 336984 [details]
firefox @ slashdot.org: corrupted
Comment 4 Matthias Dahl 2013-01-27 10:00:08 UTC
Created attachment 336986 [details]
firefox @ slashdot.org: normal
Comment 5 Matthias Dahl 2013-01-27 10:00:28 UTC
Created attachment 336988 [details]
thunderbird: corrupted
Comment 6 Matthias Dahl 2013-01-27 10:00:41 UTC
Created attachment 336990 [details]
thunderbird: normal
Comment 7 Matthias Dahl 2013-01-27 10:23:52 UTC
Two major pieces of information I forgot to add:

(a) This only happens in firefox and thunderbird. I almost exclusively use Qt-based applications, so this might be a factor. For what's it worth: I have never seen anything like that in Chromium, dolphin or konqueror.

(b) Using Xlib/XCB exclusively in cairo (enable-xlib-xcb) makes this bug either unbelievably hard to trigger or fixes/shadows it very effectively because I have yet to see a single case of this corruption since switching over to using xcb exclusively (w/ cairo master and a patched ebuild to enable this naturally).
Comment 8 Rafał Mużyło 2013-01-27 12:56:09 UTC
I've been seeing this problem for awhile too.
As my card is a very old radeon using xf86-video-ati, it doesn't seem hardware based.
I've yet got to try cairo 1.12.10-r1 (on 1.12.8), pixman is 0.28.0, kernel is 3.6.8, arch x86 - very little in common.
With firefox 18.0 it became a bit less pronounced (though perhaps it was due to a different upgrade), but it's still there.
Comment 9 Matthias Dahl 2013-01-28 07:22:52 UTC
Using XCB instead of Xlib functions in cairo does indeed solve the font corruption (which was very easy to trigger before) but unfortunately it causes infrequent corruption of page backgrounds with random contents of some graphics buffer.

AFAICR (and please correct me if I am wrong), Mozilla has patched cairo quite heavily for their own purposes and did not upstream all of those changes. My best guess is, what Mozilla is using as cairo internally, is not 100% compatible anymore with vanilla cairo. This https://bugzilla.mozilla.org/show_bug.cgi?id=722975 upstream bug is quite an interesting starting point (and we do have that patch in the tree as well).

tl;dr: I will disable system cairo here and see if this is actually the cause and report back. If it is, can we at least make this a use flag which by default is off? The releases from Mozilla which use their internal cairo look just fine (wrt font rendering), so I do not see any harm.
Comment 10 poncho 2013-01-28 11:04:24 UTC
Paul Bredbury mentions the same issue in the forums (http://forums.gentoo.org/viewtopic-p-7176654.html#7176654)
Comment 11 Andrew Saunders 2013-01-29 21:58:48 UTC
I am hit by this as well. There are two ways I could recreate it.

Go to this site http://www.chakra-project.org/ and watch the links where the moving image would scroll, if unconstrained, over the links. (whatever update I did recently seems to have fixed this bug, beit ff 18.0.1 or who knows)

This one still works however. Mouseover the "free software" link in the top paragraph, then mouseoff, do it quickly. The text "showcase project created by a bunch of" on the right will get bolder and bolder. Select the text to reset, then repeat.
Comment 12 Matthias Dahl 2013-01-30 07:28:45 UTC
Ok, since I work on a web project for a client, I use firefox all day long and wanted to be sure before updating the bug: Disabling system cairo for Firefox indeed fixes all problems (as expected).

I'll update to today's cairo master, since there have been some interesting fixes, enable system cairo again and try with cairo's xlib-xcb one more time. I'll report back once I've more info.

But one thing is sure by know: Enabling system cairo for Firefox with the current cairo versions in the tree, causes graphical glitches.
Comment 13 Matthias Dahl 2013-01-30 18:36:40 UTC
Ok, even with today's cairo master (which has seen a fair amount of fixes), there is still the same background corruption when used with xlib-xcb (fonts still look fine though). Since activating this (xlib-xcb) through normal means is not even possible, this is not really important but would have been a nice workaround to have.

So I am at the end of my rope here. If there is anything else I should try, please let me know. I will _not_ dig into the Mozilla codebase though. :)

If no one has a keen idea what is causing this and how the bug can be fixed, I would suggest either adding a system-cairo use flag to the appropriate eclass and have it default to off or completely switch to bundled cairo for the time being.
Comment 14 Rafał Mużyło 2013-01-30 19:35:21 UTC
(In reply to comment #13)
> Ok, even with today's cairo master (which has seen a fair amount of fixes),
> there is still the same background corruption when used with xlib-xcb (fonts
> still look fine though). Since activating this (xlib-xcb) through normal
> means is not even possible, this is not really important but would have been
> a nice workaround to have.
> 

Two things:
- did you try without xlib-xcb ?
- most likely it's not as much a new bug, as an old one, that had been masked before (well, it was that way with the problem fixed by patch in -r1)

As for the background corruption in firefox *with* xlib-xcb, it's an old problem - IIRC dating back to at least cairo 1.12.0.
Comment 15 Matthias Dahl 2013-02-01 09:51:30 UTC
(In reply to comment #14)

> Two things:
> - did you try without xlib-xcb ?

Always. :) In my last post I forgot to mention that I naturally also tried the cairo master checkout w/o xlib-xcb which immediately brought back the font corruption (which is really easy to trigger).

> As for the background corruption in firefox *with* xlib-xcb, it's an old
> problem - IIRC dating back to at least cairo 1.12.0.

*sigh* Pity it hasn't been fixed yet upstream because otherwise that would have been a nice workaround for the font corruption.

In all honesty, I think it would really be for the best to offer the user a choice with regard to the system cairo usage and default it to off since there are definitely problems associated with it. This also implies only conditionally applying cairo compatibility fixes to mozilla products.

The best solution would be naturally to find out what is causing both problems, fix them and be done with it. But since I don't have enough free time on my hands to dive into the mozilla and cairo codebase and do some proper debugging, I cannot help with that. :(
Comment 16 nibs 2013-02-20 17:35:01 UTC
I find I don't get the font corruption with cairo 1.12.2-r4, but this has been removed from portage. Any versions higher it appears consistently.
Comment 17 Rafał Mużyło 2013-02-21 04:06:42 UTC
It would seem that it's a bit better with cairo 1.12.14 - there's still a slight random corruption, but now it looks less fuzzy, a bit like artificial bold...
Well, at least it seems that way to me.

Given the low number of commits between .12 and .14, it could suggest that there's still a place or two where float rounding needs to be fixed.
Comment 18 zlg (RETIRED) gentoo-dev 2013-02-26 07:50:31 UTC
I've been experiencing this issue as well. My testing isn't nearly as complete as far as finding fixes. All I've done is test various fonts (to no avail) and mess with fontconfig settings (ditto).

For those of us with less knowledge on font rendering, should we switch to the binary version until the bug's fixed? I don't mind being a test subject since Firefox only takes ~15 min for me to compile.
Comment 19 Rafał Mużyło 2013-02-26 20:37:29 UTC
@comment 18: the problem here is that it's very hard to tell what the real problem here is.

As mozilla upstream will most likely be quite unhelpful (with all their internal copies), perhaps somebody should check freedesktop bugzilla for cairo bugs and if nothing similar is found, perhaps ask a question on its mailing list about what tools to use to diagnose the exact source of the problem ?
Comment 20 Serge Gavrilov 2013-03-16 08:20:55 UTC
For the time being it is enough to add 

        mozconfig_annotate '' --disable-system-cairo

into ebuild's src_configure to compile firefox with internal cairo support and workaround the bug.

It would be nice, if ebuild provide flag "system-cairo" until the bug is really fixed.
Comment 21 zlg (RETIRED) gentoo-dev 2013-03-18 06:30:14 UTC
(In reply to comment #20)
> For the time being it is enough to add 
> 
>         mozconfig_annotate '' --disable-system-cairo
> 
> into ebuild's src_configure to compile firefox with internal cairo support
> and workaround the bug.
> 
> It would be nice, if ebuild provide flag "system-cairo" until the bug is
> really fixed.

Confirmed to work for me. No font corruption on any of the pages that were doing it prior.
Comment 22 Small_Penguin 2013-08-23 18:23:09 UTC
Finally the solution to that nasty problem!

USE="-system-cairo" really helps.
Comment 23 Jory A. Pratt gentoo-dev 2017-08-26 17:56:21 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team