Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181318 - libpng-1.2.18 nongray pixel error in links -g
Summary: libpng-1.2.18 nongray pixel error in links -g
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Marcelo Goes (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-08 15:43 UTC by David Barnett
Modified: 2007-07-14 17:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch fixing the GRAY_WARN handler (graywarning-1.2.18.patch,683 bytes, patch)
2007-07-10 06:58 UTC, Steffen Wolf
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Barnett 2007-06-08 15:43:56 UTC
I recently upgraded libpng from 1.2.16 to 1.2.18. Now when I use the web browser links-2.1_pre26 in graphical mode (under X), it reports this error and closes as soon as certain pages load:
 Error when loading compiled-in font: png_do_rgb_to_gray found nongray pixel
 libpng error: png_do_rgb_to_gray found nongray pixel
 Aborted
As far as I can tell, this happens on pages with images. I get the problem on google.com but not www.dattalo.com, which is text-only.

I remerged links, but that didn't fix it. As soon as I downgraded to libpng-1.2.16 again, the problem disappeared.

Reproducible: Always

Steps to Reproduce:
1. links -g google.com
Actual Results:  
links window opens while page loads, then disappears before page displays. The error message above is left on terminal window.

Expected Results:  
loaded the web page, stayed open

Portage 2.1.2.7 (default-linux/x86/2006.1/desktop, gcc-4.1.2, glibc-2.5-r3, 2.6.18-gentoo-r6 i686)
=================================================================
System uname: 2.6.18-gentoo-r6 i686 Celeron (Mendocino)
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 07 Jun 2007 17:59:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5-r3, 2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=i686 -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distcc distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt dbus dri dvd dvdr emboss encode fam fortran gdbm gif gpm gstreamer gtk hal iconv isdnlog jpeg ldap libg++ mad midi mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre perl png ppds pppd python quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts unicode win32codecs x86 xml xorg xv zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="mach64 vesa vga"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Steffen Wolf 2007-07-05 08:12:59 UTC
The bug is reproducable. A quick workaround is to downgrade to libpng 1.2.16. A solution is to upgrade to libpng >=1.2.19beta19  More info:  Links uses png images for the fonts. It converts them to grayscale using libpng's png_do_rgb_to_gray functionality. This can return a warning or an error, if the programmer wants it to. This is set by a function png_set_rgb_to_gray_fixed(png, error_action, r, g) where error_action=1 indicates to ignore all nongray pixels.  In libpng 1.2.17beta2 they changed the evaluation of this error_action, causing it to always give an error, which causes links to abort, if it tries to display a character that was not encoded in a grayscale png-file. E.g. & #9660 ; is used on Google. Took me some time to find that out.  The good news: This bug in libpng has already been found and removed in version 1.2.19beta19 [June 28, 2007]. We should mark everything in between to be buggy. 
Comment 2 SpanKY gentoo-dev 2007-07-09 23:36:26 UTC
post the diff and i'll add it to 1.2.18-r1
Comment 3 Steffen Wolf 2007-07-10 06:58:38 UTC
Created attachment 124398 [details, diff]
Patch fixing the GRAY_WARN handler

Made from the diffs between libpng-1.2.18 and libpng-1.2.19beta19, but stripped to contain only the error handler for the GRAY_WARN and GRAY_ERR flags.
Comment 4 Steffen Wolf 2007-07-10 07:01:13 UTC
Alright, that's the patch. Worked fine for me here.
Comment 5 Andrew Austin 2007-07-14 14:41:40 UTC
(In reply to comment #4)
> Alright, that's the patch. Worked fine for me here.
> 

I tested this patch, works fine.
Comment 6 SpanKY gentoo-dev 2007-07-14 17:21:52 UTC
thanks Steffen, 1.2.18-r1 now in the tree with that patch