Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467088 - x11-base/xorg-server-1.13.4 - dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
Summary: x11-base/xorg-server-1.13.4 - dix/main.c:171:24: error: array subscript is ou...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-24 17:00 UTC by Mickaël Bucas
Modified: 2015-02-22 22:06 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,239.28 KB, text/plain)
2013-04-24 17:01 UTC, Mickaël Bucas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mickaël Bucas 2013-04-24 17:00:07 UTC
x11-base/xorg-server-1.13.4 fails to build with GCC 4.7.2, producing error message :
/var/tmp/portage/x11-base/xorg-server-1.13.4/work/xorg-server-1.13.4/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]


Reproducible: Always



Expected Results:  
As far as I can see, the subscript is within bounds, so it should not stop on this error and compilation should succeed.

# emerge --info
Portage 2.1.11.55 (default/linux/amd64/13.0, gcc-4.7.2, glibc-2.15-r3, 3.6.11-gentoo x86_64)
=================================================================
System uname: Linux-3.6.11-gentoo-x86_64-AMD_Phenom-tm-_II_X6_1090T_Processor-with-gentoo-2.2
KiB Mem:    16178908 total,    128324 free
KiB Swap:    8388604 total,   8365456 free
Timestamp of tree: Wed, 24 Apr 2013 00:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.7.2-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo webapp-experimental roslin gamerlay sunrise x11 hasufell x-myoverlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -fomit-frame-pointer -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -pipe -fomit-frame-pointer -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/  ftp://gentoo.imj.fr/pub/gentoo/  ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo  http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/  ftp://de-mirror.org/gentoo/  http://mirror.qubenet.net/mirror/gentoo/  ftp://mirror.bytemark.co.uk/gentoo/  rsync://gentoo.lagis.at/gentoo-distfiles/  http://tux.rainside.sk/gentoo/  http://de-mirror.org/gentoo/  http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.netcologne.de/gentoo/"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
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="/var/lib/layman/webapps-experimental /var/lib/layman/roslin /var/lib/layman/gamerlay /var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/hasufell /var/lib/myoverlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X alsa amd64 bash-completion berkdb bzip2 cairo cgraph cli consolekit cracklib crypt cxx dbus dri encode esd exif ffmpeg flac fontconfig fortran gd gif gnome gpm graphviz gstreamer gtk gudev iconv imlib ipv6 java jpeg kde lm_sensors logrotate mad mmx mng modules mp3 mpeg mudflap multilib mysql ncurses nls nptl nsplugin ogg opengl openmp pam pango pcre perl php png policykit python qt3 qt3support qt4 quicktime readline samba sdl semantic-desktop session spell sql sse sse2 ssl svg tcpd tiff truetype udev unicode vhosts vorbis webkit xml xmms xpm xv zlib" ABI_X86="64" 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 auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd 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="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" OFFICE_IMPLEMENTATION="libreoffice" 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="radeon" 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 Mickaël Bucas 2013-04-24 17:01:39 UTC
Created attachment 346486 [details]
build.log
Comment 2 Weedy 2013-04-25 05:56:42 UTC
Not version specific. Running ~ here with 4.7.2

libtool: link: x86_64-pc-linux-gnu-ar cru .libs/libdix.a .libs/atom.o .libs/colormap.o .libs/cursor.o .libs/devices.o .libs/dispatch.o .libs/dixfonts.o .libs/dixutils.o .libs/enterleave.o .libs/events.o .libs/eventconvert.o .libs/extension.o .libs/ffs.o .libs/gc.o .libs/getevents.o .libs/globals.o .libs/glyphcurs.o .libs/grabs.o .libs/initatoms.o .libs/inpututils.o .libs/pixmap.o .libs/privates.o .libs/property.o .libs/ptrveloc.o .libs/region.o .libs/registry.o .libs/resource.o .libs/selection.o .libs/swaprep.o .libs/swapreq.o .libs/tables.o .libs/touch.o .libs/window.o 
libtool: link: x86_64-pc-linux-gnu-ranlib .libs/libdix.a
libtool: link: ( cd ".libs" && rm -f "libdix.la" && ln -s "../libdix.la" "libdix.la" )
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c: In function 'main':
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:140:13: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1/dix/main.c:171:24: error: array subscript is outside array bounds [-Werror=array-bounds]
cc1: some warnings being treated as errors
make[2]: *** [main.lo] Error 1
make[2]: Leaving directory `/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1_build/dix'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/x11-base/xorg-server-1.14.1/work/xorg-server-1.14.1_build/dix'
make: *** [all-recursive] Error 1
Comment 3 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-04-25 08:46:48 UTC
Does it happen too if you build with -O2 instead of -O3 in CFLAGS?
Comment 4 Mickaël Bucas 2013-04-25 12:09:08 UTC
The build ends with success with -O2 in CFLAGS
Comment 5 Weedy 2013-04-26 03:57:08 UTC
It's -ftree-vectorize.
I use -O2 with "-fprefetch-loop-arrays -ftree-vectorize" set manually.
Comment 6 Tolga Dalman 2013-09-18 20:51:06 UTC
I'm seeing this as well with xorg-server 1.14.3.
 
C{XX}FLAGS="-march=native -mtune=native -O2 -momit-leaf-frame-pointer -pipe         -fvect-cost-model -fpredictive-commoning -flto=8"

Works perfectly with -march=native -O2.
Comment 7 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-09-18 21:21:54 UTC
It would be good if you report this also upstream at https://bugs.freedesktop.org/ and provide the link to the report here.
Comment 8 Tolga Dalman 2013-09-18 21:50:16 UTC
The root cause is -Werror in x11-misc/util-macros which, I believe, upstream won't change. We have hit Xorg bugs that are related to Werror in the past already (e.g., Bug 435640 and Bug 463666).
Comment 9 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-09-18 22:07:59 UTC
array-bounds warning typically points to an actual problem with the code.

The -Werror issue is bug 416069.
Comment 10 Matt Turner gentoo-dev 2015-02-22 22:06:29 UTC
I assume this has been fixed long ago. I don't see it with 1.17.1 FWIW. Closing as OBSOLETE.