Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415005 - x11-drivers/xf86-input-wacom-0.14.0 CFLAGS=-O3 - .../work/xf86-input-wacom-0.14.0/src/wcmUSB.c:374:8: error: array subscript is above array bounds
Summary: x11-drivers/xf86-input-wacom-0.14.0 CFLAGS=-O3 - .../work/xf86-input-wacom-0....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Auty (RETIRED)
URL: https://sourceforge.net/tracker/?func...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-07 10:47 UTC by Ștefan Talpalaru
Modified: 2012-06-23 19:32 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,23.17 KB, text/plain)
2012-05-07 11:11 UTC, Ștefan Talpalaru
Details
Patch to ensure the loop only ever visits elements of the mouse_codes array (xf86-input-wacom-0.14.0-O3.patch,476 bytes, patch)
2012-05-10 07:51 UTC, Mike Auty (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ștefan Talpalaru 2012-05-07 10:47:36 UTC
When -O3 is in CFLAGS xf86-input-wacom-0.14.0 fails with:
 wcmUSB.c:374:8: error: array subscript is above array bounds

It works with -O2.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-07 10:56:56 UTC
1) Please post your `emerge --info' output in a comment.
2) Please attach the entire build log to this bug report.
Comment 2 Ștefan Talpalaru 2012-05-07 11:10:33 UTC
Portage 2.1.10.57 (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.15-r1, 3.3.4-pf x86_64)
=================================================================
System uname: Linux-3.3.4-pf-x86_64-AMD_Phenom-tm-_II_X6_1090T_Processor-with-gentoo-2.1
Timestamp of tree: Mon, 07 May 2012 10:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.7 [disabled]
app-shells/bash:          4.2_p28
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.8-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.5-r1, 1.9.6-r3, 1.11.5
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.7
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.3 (virtual/os-headers)
sys-libs/glibc:           2.15-r1
Repositories: gentoo localrepo sunrise
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=native -pipe -fomit-frame-pointer -fno-ident -floop-interchange -floop-strip-mine -floop-block -ffast-math -mfpmath=sse"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/firefox/plugins /usr/share/bash-completion/gentoo /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O3 -march=native -pipe -fomit-frame-pointer -fno-ident -floop-interchange -floop-strip-mine -floop-block -ffast-math -mfpmath=sse"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
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://mirrors.linuxant.fr/distfiles.gentoo.org/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.wheel.sk/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="en"
MAKEOPTS="-j6"
PKGDIR="/var/tmp/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-q"
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 /var/lib/layman/sunrise"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 apache2 bash-completion bitmap-fonts branding bzip2 cairo caps cdaudio cdda cddb cdr cdrtools cli consolekit cracklib crypt css cuda cups curl custom-cxxflags cxx dbus divx4linux dri dssi dts dv dvb dvd dvdnav dvdr dvdread emboss enca encode exif fam fftw firefox flac fontconfig fortran gallium gdbm gdu gif gimp gpm gtk gtk2 hal iconv imagemagick imlib jack javascript jemalloc jpeg jpeg2k ladspa lame lapack lcdfilter lcms lensfun libnotify libsamplerate libsexy lm_sensors lua lzma mad matroska mime mmap mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib musicbrainz ncurses nls nptl nvidia offensive ogg oggvorbis opencl openexr opengl openmp oss pam pango pch pcre pdf png policykit ppds pppd pvr python qt3support qt4 quicktime readline schroedinger sdl semantic-desktop session sharedmem smp sndfile sox speex spell srtp sse sse2 sse3 sse4a ssl startup-notification svg taglib tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb v4l2 vaapi vdpau vim-syntax vorbis vpx webkit webp x264 xcb xcomposite xml xml2 xmms xmp xorg xpm xprint xulrunner xv xvid xvmc yahoo zlib zvbi" 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="*" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi 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 so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="usb-dib0700" 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 wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" LIRC_DEVICES="devinput" PHP_TARGETS="php5-3 php5-4" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="vesa nv nvidia" 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, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 3 Ștefan Talpalaru 2012-05-07 11:11:21 UTC
Created attachment 311079 [details]
build.log
Comment 4 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-05-10 03:25:31 UTC
Is upstream aware of this problem? If so please provide link to the upstream bug here.
Comment 5 Mike Auty (RETIRED) gentoo-dev 2012-05-10 07:51:08 UTC
Created attachment 311317 [details, diff]
Patch to ensure the loop only ever visits elements of the mouse_codes array

Could you please test the following patch?  It just changes the array boundaries of the for loop from size(mouse_codes) to 1, down to size(mouse_codes) - 1 to 0.  If you need instructions as to how to apply it or anything, just let me know...
Comment 6 Ștefan Talpalaru 2012-05-10 09:44:38 UTC
The patch works. I've compiled and tested xf86-input-wacom with -O3 and it's all good.

Chí-Thanh, I haven't reported upstream.
Comment 7 Mike Auty (RETIRED) gentoo-dev 2012-05-10 20:00:23 UTC
Thanks for testing that, this has now been reported upstream as linuxwacom bug 3525615...
Comment 8 Mike Auty (RETIRED) gentoo-dev 2012-06-23 19:32:32 UTC
This should be fixed in 0.15.0, which is now in the tree.  Please test this, and reopen the bug if you're still experiencing problems...