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

Bug 420127

Summary: x11-base/xorg-server-1.11.4-r1 fails compilation xf86EdidModes.c error: array subscript is above array bounds
Product: Gentoo Linux Reporter: Corvus Corax <corvuscorax>
Component: [OLD] UnspecifiedAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: major CC: kjackie
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: complete build log
environment file from build directory

Description Corvus Corax 2012-06-07 15:44:50 UTC
...
...
CC     xf86Modes.lo
...
var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c: In function 'handle_detailed_modes':
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:750:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:749:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:748:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:747:33: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:750:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:749:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:748:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:747:33: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:750:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:749:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:748:19: error: array subscript is above array bounds
/var/tmp/portage/x11-base/xorg-server-1.11.4-r1/work/xorg-server-1.11.4/hw/xfree86/modes/xf86EdidModes.c:747:33: error: array subscript is above array bounds
make[4]: *** [xf86EdidModes.lo] Error 1


Reproducible: Always

Steps to Reproduce:
1. emerge xorg-server

Actual Results:  
ebuild fails compilation

Expected Results:  
ebuild compiles

emerge --info =x11-base/xorg-server-1.11.4-r1
Portage 2.1.10.49 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoocorvusmc x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.2.12-gentoocorvusmc-x86_64-AMD_A4-3305M_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.1
Timestamp of tree: Thu, 07 Jun 2012 15:00:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r1, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=amdfam10 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /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="-O3 -march=amdfam10 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j3"
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=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X acl acpi alsa amd64 apng berkdb bluetooth bzip2 cli cracklib crypt cups cxx device-mapper doc dri ffmpeg fluidsynth fontconfig fortran gd gdbm glade gpm gtk iconv icu imap ipv6 jadetex jpeg jpeg2k kpathsea lame latex libnotify libsamplerate loop-aes lua midi mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl ogg opengl openmp pam pcre pdf phonon png posix pppd qt3support qt4 readline samba session sid sndfile sse sse2 sse3 sse4_1 ssl svg tcpd theora thunar tiff truetype udev unicode v4l v4l2 vim-syntax vorbis wavpack wmf x264 xinerama xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fglrx" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Corvus Corax 2012-06-07 15:49:26 UTC
Created attachment 314599 [details]
complete build log
Comment 2 Corvus Corax 2012-06-07 15:54:47 UTC
Created attachment 314601 [details]
environment file from build directory
Comment 3 jackieku 2012-06-08 06:05:35 UTC
Change -O3 to -O2 can get rid of these errors.
Comment 4 Corvus Corax 2012-06-08 12:11:07 UTC
Thanks for the hint, yeah knowing the way GCC does checks, I think with -O2 or less that error would indeed disappear.

Although I'd rephrase that as "changing to -O2 will make the compiler too dump to notice the flaw".
They'd still be there, being an unchecked array out of bounds error waiting to happen at runtime (aka buffer overflow, segfault, ...) won't they?

I built my entire system with -O3 for ages. Previous versions of xorg worked fine with -O3. While there are some ebuilds that I know enforce lower optimization settings for particular packages, I'm not sure if that would be the apropriate action here, or if that would just mask apossible upstream bug that should rather justify masking the entire xorg version as unsafe?

I mean just look at all these thousands of warnings about incompatible function prototypes, I'd say something is seriously wrong upstream or on behalf of some patches here - as far as coding standards are concerned, isn't it? And Xorg is a pretty critical core package at least on desktop systems.

I just reproduced the bug on a second system, same package, same error during emerge -u world
Comment 5 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-06-08 12:18:25 UTC

*** This bug has been marked as a duplicate of bug 402285 ***