Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 445594 - sys-apps/coreutils - FAIL: tests/cp/ - Fails src_test with -march=native : valgrind "unrecognised instruction"
Summary: sys-apps/coreutils - FAIL: tests/cp/ - Fails src_test with -marc...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Anthony Basile
Depends on:
Reported: 2012-12-02 10:47 UTC by Chris Kerr
Modified: 2014-04-27 18:24 UTC (History)
0 users

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

build.log (build.log,708.00 KB, text/plain)
2012-12-02 10:47 UTC, Chris Kerr

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kerr 2012-12-02 10:47:39 UTC
Created attachment 331190 [details]

When emerging coreutils with CFLAGS="-march=native", one of the valgrind tests fails with the following error

vex amd64->IR: unhandled instruction bytes: 0xC5 0xFA 0x10 0x45 0x8 0x48 0x89 0xDF
==21470== valgrind: Unrecognised instruction at address 0x40b488.
==21470==    at 0x40B488: hash_initialize (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
==21470==    by 0x408E3F: hash_init (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
==21470==    by 0x40396F: main (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
==21470== Your program just tried to execute an instruction that Valgrind
==21470== did not recognise.  There are two possible reasons for this.
==21470== 1. Your program has a bug and erroneously jumped to a non-code
==21470==    location.  If you are running Memcheck and you just saw a
==21470==    warning about a bad jump, it's probably your program's fault.
==21470== 2. The instruction is legitimate but Valgrind doesn't handle it,
==21470==    i.e. it's Valgrind's fault.  If you think this is the case or
==21470==    you are not sure, please let us know and we'll try to fix it.
==21470== Either way, Valgrind will now raise a SIGILL signal which will
==21470== probably kill your program.
==21470== Process terminating with default action of signal 4 (SIGILL)
==21470==  Illegal opcode at address 0x40B488
==21470==    at 0x40B488: hash_initialize (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
==21470==    by 0x408E3F: hash_init (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
==21470==    by 0x40396F: main (in /gob/portage/tmp/portage/sys-apps/coreutils-8.20/work/coreutils-8.20/src/cp)
./tests/cp/ line 28: 21470 Illegal instruction     valgrind --quiet --error-exitcode=3 cp j j2
Comment 1 Chris Kerr 2012-12-02 10:49:24 UTC
I think possibly the fact I have USE=gmp enabled is relevant
Comment 2 Chris Kerr 2012-12-02 10:50:16 UTC
# emerge --info
Portage (default/linux/amd64/10.0/desktop/kde, gcc-4.6.3, glibc-2.15-r2, 3.5.7-gentoo x86_64)
System uname: Linux-3.5.7-gentoo-x86_64-AMD_FX-tm-4100_Quad-Core_Processor-with-gentoo-2.1
Timestamp of tree: Sun, 02 Dec 2012 10:00:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.5
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo zfs science seden voip Local-overlay
ACCEPT_LICENSE="* -@EULA @FREE AdobeFlash-10.3 skype-"
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /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"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms splitdebug strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv"
FFLAGS="-march=native -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB eo"
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"
PORTDIR_OVERLAY="/var/lib/layman/zfs /var/lib/layman/science /var/lib/layman/seden /var/lib/layman/voip /usr/local/portage"
USE="X a52 aac acl acpi alsa amd64 amr avahi avx bash-completion berkdb boost branding bs2b bzip2 cairo cdda cddb cdr celt cjk cli consolekit cracklib crypt cups cxx dbus declarative device-mapper dga directfb djvu dri dtmf dts dv dvd dvdr emboss encode exif fam fbcon ffmpeg fftw firefox flac fortran gdbm gif gimp git gnuplot gpm gps gsm gstreamer gtk h323 iconv icu idn ilbc inotify ipv6 ivr jabber jingle jpeg jpeg2k kde kipi kontact lame lapack latex lcms libnotify libsamplerate lm_sensors lzma mad mjpeg mmx mmxext mng modules mp3 mp4 mpeg msn mtp mudflap multilib musicbrainz ncurses nls nptl nsplugin ntp ogg openexr opengl openmp openvg otr pam pango pch pcre pdf phonon plasma png policykit ppds pppd prison pulseaudio qt3support qt4 raw readline schroedinger sdl semantic-desktop session sip sipim smp speex spell srtp sse sse2 sse4_1 ssl ssse3 startup-notification svg taglib tcpd theora threads tiff truetype udev udisks unicode upower usb vorbis vpx wav wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid xvmc yahoo zeroconf 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="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="garmin garmintxt" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console nlpsolver pdfimport wiki-publisher" LINGUAS="en en_GB eo" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon r100 r200 r300 r600 radeonsi vesa" 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"
Comment 3 SpanKY gentoo-dev 2012-12-07 20:39:57 UTC
sounds like a valgrind problem
Comment 4 Anthony Basile gentoo-dev 2012-12-23 13:36:15 UTC
(In reply to comment #1)
> I think possibly the fact I have USE=gmp enabled is relevant

1) What's your current version of valgrind: `valgrind --version`

2) Leaving everything else the same, can you try '-march=nocona' and see if this works, but '-march=native' doesn't.

3) If you are not using the latest valgrind 3.8.1, please upgrade and try again, both '-march=nocona' and '-march=native'

4) Let me see your cpu flags: `cat /proc/cpuinfo`

I'm working on the theory that this is the old avx problem: bug #398447