Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 303185 - sci-libs/blas-atlas-3.9.21 build fails due to segfault of atlas tuning code
Summary: sci-libs/blas-atlas-3.9.21 build fails due to segfault of atlas tuning code
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Science Related Packages
URL: http://sourceforge.net/tracker/?func=...
Whiteboard:
Keywords:
: 315769 (view as bug list)
Depends on:
Blocks: 372323
  Show dependency tree
 
Reported: 2010-02-02 06:52 UTC by Jiri Pittner
Modified: 2013-01-31 11:07 UTC (History)
6 users (show)

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


Attachments
bzip2ed /var/tmp/portage/sci-libs/blas-atlas-3.9.21/temp/build.log (build.log.bz2,108.74 KB, application/octet-stream)
2010-02-04 23:16 UTC, Juergen Rose
Details
core file with debug symbols (bug.tar.gz,220.91 KB, application/octet-stream)
2010-02-19 20:21 UTC, Jiri Pittner
Details
zerotime.patch (zerotime.patch,682 bytes, patch)
2010-02-21 02:26 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Pittner 2010-02-02 06:52:43 UTC
emerge --update to blas-atlas-3.9.21 fails:
BEST CASE 60 percent of L1, MFLOP=377.93


BEGIN L2-BLOCKED TUNING
   1:ATL_gerk_axpy.c gets 377.91 MFLOPS
   2:ATL_gerk_4x4_1.c gets 377.93 MFLOPS
   3:ATL_gerk_1x4_0.c gets 377.91 MFLOPS
   4:ATL_gerk_8x4_0.c gets 377.91 MFLOPS
DONE L2-BLOCKED TUNING, CHOSE 'ATL_gerk_4x4_1.c' (377.93)
     M       N     lda  percL1       mflop
======  ======  ======  ======  ==========
  2300    2300    2300     150     377.91
  2300    2300    2300     800     377.91
  2300    2300    2300     450     377.93
  2300    2300    2300     300     377.91
  2300    2300    2300     200     377.91
  2300    2300    2300     250     377.91
  2300    2300    2300     350     377.93
  2300    2300    2300     400     377.93
  2300    2300    2300     600     377.91
  2300    2300    2300     500     377.91
  2300    make[3]: *** [res/dR1SUMM] Segmentation fault
make[3]: Leaving directory `/scratch/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/tune/blas/ger'
make[2]: *** [/scratch/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/tune/blas/ger/res/dR1SUMM] Error 2
make[2]: Leaving directory `/scratch/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/bin'
ERROR 955 DURING R1TUNE!!.  CHECK INSTALL_LOG/dR1TUNE.LOG FOR DETAILS.
make[2]: Entering directory `/scratch/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/bin'

I could not locate any core file in the build directories.



Reproducible: Always

Steps to Reproduce:
1.emerge --update blas-atlas
2.
3.

Actual Results:  
segfault in atlas tuning

Expected Results:  
installed atlas-blas library

dev-java/java-config: 1.3.7-r1, 2.1.10
dev-lang/python:     2.4.6, 2.5.4-r4, 2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.1.0_beta1
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
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.2
sys-devel/binutils:  2.16.1-r3, 2.17-r1, 2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4m -msse2 -pipe -fno-omit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /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 /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4m -msse2 -pipe -fno-omit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.sh.cvut.cz/MIRRORS/gentoo ftp://mirror.switch.ch/mirror/gentoo/ http://gentoo.supp.name/ "
LANG="C"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/scratch/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib ac3 acl acpi alsa amr berkdb blas bluetooth bonobo branding bzip2 cairo cddb cdparanoia cdr cli consolekit cracklib crypt cxx dbus dri dts dv dvb dvd dvdnav dvdr dvdread eds emboss encode evo exif extra fam ffmpeg firefox flac fortran ftp gcj gd gdbm gif gnome gphoto2 gpm gps graphics gsm gstreamer gtk hal http hwac3 icc iconv ieee1394 imagemagick imap ipv6 jabber java javascript jpeg jpeg2k kde kpathsea lapack ldap lesstif libnotify libwww lirc lm_sensors lprng mad mbox mikmod mime mmap mmx mng modules mozilla mp3 mp4 mpeg mpi mudflap music mysql nas ncurses nls nptl nptlonly nsplugin obex ogg opengl openmp paste64 pcmcia pcre pdf perl plotutils png posix ppds pppd pstricks publishers python qt3support qt4 quicktime readline reflection samba scanner science sdl session sharedmem smartcard sndfile sockets socks5 sox spell spl sse sse2 ssl startup-notification svg svga sysfs tcl tcltk tcpd tetex threads thunar tiff tk truetype unicode usb usrp v4l v4l2 vcd vorbis wifi win32codecs wxwindows x264 x86 xine xml xmms xorg xpm xv xvid zlib zrtp" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon radeon-hd vesa sc fbdev v4l vga" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2010-02-02 07:07:19 UTC
Please, attach full build.log.
Comment 2 Juergen Rose 2010-02-04 23:13:03 UTC
I have the same error.
Comment 3 Juergen Rose 2010-02-04 23:14:32 UTC
root@thinkpad:/home/rose(60)# emerge --info  =sci-libs/blas-atlas-3.9.21
Portage 2.1.7.17 (default/linux/x86/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.32-gentoo-r3 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.32-gentoo-r3-i686-Intel-R-_Pentium-R-_M_processor_2.00GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 04 Feb 2010 00:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4-r1, 3.1.1-r1
dev-python/pycrypto: 2.1.0
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.4_p6, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc:       3.4.6-r2, 4.4.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 skype-eula"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/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="-O2 -march=pentium-m -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=pentium-m -fomit-frame-pointer"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ rsync://ftp.fi.muni.cz/pub/linux/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="de fr"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/dotnet /var/lib/layman/java-overlay /var/lib/layman/lordvan /var/lib/layman/science /var/lib/layman/x11 /var/lib/layman/zugaina /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac acl acpi administrator afs alsa amrr ao aotuv apache2 asf aspell atlas audacious audiofile automount bash-completion beagle berkdb blas bluetooth boo boost branding bzip2 c++ cairo cardbus cdda cddb cdf cdio cdparanoia cdr cgi chm cli consolekit corba cracklib crypt cups curl cxx daap dbus device-mapper dga dia djvu doc dri ds2490 dts dv dvb dvd dvdr dvi dxr3 eds elf emacs emboss encode epiphany evo examples exif expat extensions extra extras fam fame ffmpeg fftw firefox fits flac fltk foomaticdb fortran fpx fts3 fuse galago garmin gd gdal gdbm geolocation geos gif gimp ginac git glade glib glitz gml gmp gnokii gnome gnome-keyring gnuplot gnutls gphoto2 gpm graphics graphtft graphviz gs gsl gsm gstreamer gtk guile hal harness hddtemp hdf hdf5 hlapi http httpd iconv icq icu id3 ide imagemagick imap innodb ipod ipv6 irda ithreads jabber jadetex java java5 java6 jbig john jpeg jpeg2k kde kdrive kerberos kexi kpathsea ladspa lame lapack laptop latex lcms ldap libffi libgda libnotify libsamplerate lirc lua lzo mad madwifi mail maildir mailwrapper math matroska mikmod mmx mmxext mng modules mono motif mozdevelop mozilla mp3 mp4 mpeg mpi mplayer mtp mudflap musicbrainz mysql mysqli nautilus ncurses neXt netcdf netpbm network networking networkmanager nfs nls nntp nptl nptlonly nsplugin ntfs ntp numarray numeric obex objc ocaml octave odbc ogdi ogg ole openexr opengl openmp overview pam pcre pda pdf perl plotutils plugins png podcast policykit posix postgres postscript ppds pppd preview-latex proj projectx pstricks pulseaudio pymol python qemu qhull qt3support qt4 quicktime readline reflection reiserfs rle romio rpc rrdcgi rrdtool samba sasl science sdl semantic-desktop server session slang slp smbclient sndfile snmp soup sox speex spell spl sql sqlite sse sse2 ssl startup-notification stlport subtitles subversion suexec svg swig sysfs szip t1lib tcl tcpd tex tex4ht texmacs theora thinkpad threads thunar thunderbird tidy tiff tk tntc tools truetype udev unicode usb userlocales utempter v4l2 virtualbox vorbis wav webdav webdav-serf webkit wifi win32codecs wmf wxwidgets x264 x86 xattr xcb xemacs xext xine xml xmlreader xmlrpc xorg xpm xulrunner xv xvid xvmc zlib zvbi" ALSA_CARDS="intel8x0 ac97_codec emu10k1 emu10k1x" 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_dbd authn_dbm authn_default authn_file 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 so speling status unique_id userdir usertrack vhost_alias" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="keyboard mouse                evdev                synaptics               " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy gsf harness ide identity j2ee java mobility nb php profiler ruby websvccommon xml" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18 jruby" USERLAND="GNU" VIDEO_CARDS="radeon vesa displaylink" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sci-libs/blas-atlas-3.9.21 was built with the following:
USE="doc -debug" 

Comment 4 Juergen Rose 2010-02-04 23:16:20 UTC
Created attachment 218469 [details]
bzip2ed  /var/tmp/portage/sci-libs/blas-atlas-3.9.21/temp/build.log
Comment 5 Juergen Rose 2010-02-09 10:30:07 UTC
Almost the same error happens with blas-atlas-3.9.21-r1, now with gcc-4.4.3 at an other i686 computer:
emerge -uvND blas-atlas:
...
   DONE  STAGE 2-3-5 at 19:44


   BEGIN STAGE 2-3-6: GER TUNE at 19:44
make -f Makefile INSTALL_LOG/zR1SUMM pre=z 2>&1 | ./xatlas_tee INSTALL_LOG/zR1TUNE.LOG
make[2]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'
cd /var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger ; make res/zR1SUMM pre=z
make[3]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger'
./xr1ksearch -p z

      Read in L1 Cache size as = 128KB.
make[3]: *** [res/zR1SUMM] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger'
make[2]: *** [/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger/res/zR1SUMM] Error 2
make[2]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'
Comment 6 Juergen Rose 2010-02-09 10:39:56 UTC
In /var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin/INSTALL_LOG/zR1TUNE.LOG I find:
...
*       BEGAN ATLAS3.9.21 INSTALL OF SECTION 2-3-7 ON 02/09/2010 AT 19:44     *
...
make[2]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'
cd /var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger ; make res/zR1SUMM pre=z
make[3]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger'
./xr1ksearch -p z

      Read in L1 Cache size as = 128KB.
make[3]: *** [res/zR1SUMM] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger'
make[2]: *** [/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger/res/zR1SUMM] Error 2
make[2]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'
Comment 7 Markus Dittrich (RETIRED) gentoo-dev 2010-02-12 02:54:41 UTC
(In reply to comment #6)
> make[2]: Leaving directory
> `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'
> 

From your logs I can't unfortunately tell what the problem is. atlas recognizes
your CPU as a P-M for which is doesn't have any arch defaults and hence does
a full blown bootstrap which eventually causes the segfault. 

In addition, your CPU seems to have CPU throttling enabled (at least atlas
thinks so). Before we go any further can you please make sure to turn
throttling off completely and then try again. If that still fails, could you dial
your CFLAGS back to -O2 and see how far that gets you.

@Jiri:

Could you please post your logs as well!
Comment 8 Juergen Rose 2010-02-15 11:39:20 UTC
Hi Markus,

what is the best way to turn off cpu throttling, change the BIOS settings, pass ACPI=off at boot command line or just stop cpufreqd?

Regards
Comment 9 Juergen Rose 2010-02-15 11:55:04 UTC
Markus,

what do mean exactly by "dial your CFLAGS back to -O2"? My CFLAGS are set to '-O2 -march=pentium-m -fomit-frame-pointer'. Should I remove 'march=pentium-m -fomit-frame-pointer' from CFLAGS?

Comment 10 Juergen Rose 2010-02-16 12:45:06 UTC
I have here an old P4 system without HT.

root@tiger:/root(31)# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Pentium(R) 4 CPU 1.60GHz
stepping        : 4
cpu MHz         : 1600.000
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm up pebs bts
bogomips        : 3200.06
clflush size    : 64
cache_alignment : 128
address sizes   : 36 bits physical, 32 bits virtual
power management:

Cpufread is stopped, scaling governor is performance, cur_freq's are equal to max_freq and there is on one cpu in /sys/devices/system/cpu:

root@tiger:/root(32)# /etc/init.d/cpufreqd status
 * status: stopped
root@tiger:/root(33)# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
root@tiger:/root(34)# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
p4-clockmod
root@tiger:/root(35)# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1600000
root@tiger:/root(36)# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1600000
root@tiger:/root(37)# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
1600000
root@tiger:/root(38)# ll -d /sys/devices/system/cpu/cpu[0-9]
drwxr-xr-x 5 root root 0 Feb 16 12:51 /sys/devices/system/cpu/cpu0/


'emerge blas-atlas' fails with:
root@tiger:/root(39)# emerge -vuND blas-atlas
...
BEST CASE 300 percent of L1, MFLOP=176.36

BEST Lmake[3]: *** [res/dR1SUMM] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger'
make[2]: *** [/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/tune/blas/ger/res/dR1SUMM] Error 2
make[2]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.21-r1/work/ATLAS/gentoo-build/bin'


Have I really to disable throttling in the BIOS?



Comment 11 Markus Dittrich (RETIRED) gentoo-dev 2010-02-19 02:46:35 UTC
I've just added blas/lapack-atlas-3.9.23 to portage. Please see
if that fixes your problems.

> 
> Have I really to disable throttling in the BIOS?
> 

First off, I don't really think the problems are related to throttling issues
but it is worth a try.
Second, and more importantly, please don't treat blas-atlas as a regular
package compilation since it is not. In order to obtain the best possible 
performance on your particular machine atlas goes through a large number
of tests and benchmarks to find the optimal set of parameters. This will only work
if the CPU delivers consistent performance during the whole procedure. Any
additional system load will interfere and certainly any type of throttling.
If you have a lot of interference your atlas install will be suboptimal and 
potentially even worse than if you would have just emerge the blas/lapack 
reference ebuilds. Hard to say, really.

Best,
Markus

Comment 12 Jiri Pittner 2010-02-19 08:46:33 UTC
I of course understand that there is performance measurement involved
in the atlas installation - it's already in its acronym. I thought that
echo performance > /sys/devices/system/cpu/cpu0,1/cpufreq/scaling_governor
before the emerge is sufficient.
However, I think in no case should the tuning test programs crash by a coredump, right?
The problem is that find . -name '*core*' in the install workdir did not reveal
any core file, so we do not know exactly what crashed.
I thought the sandbox process involved in emerge allows coredumps to be created,
or should I perhaps try (in tcsh) 'unlimit coredumpsize; emerge ...'? 
Comment 13 Markus Dittrich (RETIRED) gentoo-dev 2010-02-19 14:25:01 UTC
> any core file, so we do not know exactly what crashed.

Maybe first try fist if the new blas-atlas-3.9.23 works for you.
I agree that it is very unlikely that the crash is due to CPU
throttling - then again, weird things happen ;) 

The best would be to compile blas-atlas with debugging symbols
and after a crash cd into /var/tmp and run the segfaulting 
command within gdb to get a backtrace or at least trigger a
core dump (you might have to adjust ulimit -c).

In any case, does atlas recognize your CPU as PM as in Juergen's
case? I've tried compiling atlas on my old P4m an all is well.

Thanks,
Markus


Comment 14 Jiri Pittner 2010-02-19 20:21:18 UTC
Created attachment 220391 [details]
core file with debug symbols

crash generated using blas 3.9.23 and gcc 4.4.3 p1.0
Comment 15 Jiri Pittner 2010-02-19 20:26:02 UTC
The bug persists in version 3.9.23 compiled with gcc (Gentoo 4.4.3 p1.0) 4.4.3.
It crashes in directory /scratch/tmp/portage/sci-libs/blas-atlas-3.9.23/work/ATLAS/gentoo-build/tune/blas/ger
crashed executable 
./xr1ksearch -p d

      Read in L1 Cache size as = 32KB.

Cases read in:
ID=1 ROUT='ATL_gerk_axpy.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=1 XU=16 \
   LDAMUL=0 FYU=0 X87=0 
ID=2 ROUT='ATL_gerk_4x4_1.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=4 \
   LDAMUL=0 FYU=0 X87=0 
ID=3 ROUT='ATL_gerk_1x4_0.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=1 \
   LDAMUL=0 FYU=0 X87=0 
ID=4 ROUT='ATL_gerk_8x4_0.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=0 FYU=0 X87=0 
ID=6 ROUT='ATL_dgerk_4x8_sse.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=3 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=16 FYU=0 X87=0 

BEGIN BASIC KERNEL TESTS:
   Kernel ATL_gerk_axpy.c(1) passes basic test
   Kernel ATL_gerk_4x4_1.c(2) passes basic test
   Kernel ATL_gerk_1x4_0.c(3) passes basic test
   Kernel ATL_gerk_8x4_0.c(4) passes basic test
   Kernel ATL_dgerk_4x8_sse.c(6) passes basic test
DONE BASIC KERNEL TESTS:


Surviving cases:
ID=1 ROUT='ATL_gerk_axpy.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=1 XU=16 \
   LDAMUL=0 FYU=0 X87=0 
ID=2 ROUT='ATL_gerk_4x4_1.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=4 \
   LDAMUL=0 FYU=0 X87=0 
ID=3 ROUT='ATL_gerk_1x4_0.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=1 \
   LDAMUL=0 FYU=0 X87=0 
ID=4 ROUT='ATL_gerk_8x4_0.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=0 FYU=0 X87=0 
ID=6 ROUT='ATL_dgerk_4x8_sse.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=3 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=16 FYU=0 X87=0 

BEGIN L1-BLOCKED TUNING
   1:ATL_gerk_axpy.c gets 377.91 MFLOPS
   2:ATL_gerk_4x4_1.c gets 377.91 MFLOPS
   3:ATL_gerk_1x4_0.c gets 377.93 MFLOPS
   4:ATL_gerk_8x4_0.c gets 377.91 MFLOPS
DONE L1-BLOCKED TUNING, CHOSE 'ATL_gerk_1x4_0.c' (377.93)
     M       N     lda  percL1       mflop
======  ======  ======  ======  ==========
  2300    2300    2300      50     377.91
  2300    2300    2300     100     377.91
  2300    2300    2300      74     377.91
  2300    2300    2300      62     330.68
  2300    2300    2300      56     377.91
  2300    2300    2300      52     377.91
  2300    2300    2300      54     377.91
  2300    2300    2300      58     377.91
  2300    2300    2300      60     377.93
  2300    2300    2300      68     377.91
  2300    2300    2300      64     377.91
  2300    2300    2300      66     377.91
  2300    2300    2300      70     377.91
  2300    2300    2300      72     377.91
  2300    2300    2300      86     377.93
  2300    2300    2300      80     330.68
  2300    2300    2300      76     377.91
  2300    2300    2300      78     377.91
  2300    2300    2300      82     377.91
  2300    2300    2300      84     377.93
  2300    2300    2300      92     377.91
  2300    2300    2300      88     377.91
  2300    2300    2300      90     377.91
  2300    2300    2300      96     377.91
  2300    2300    2300      94     377.91
  2300    2300    2300      98     377.91

BEST CASE 60 percent of L1, MFLOP=377.93
BEGIN L2-BLOCKED TUNING
   1:ATL_gerk_axpy.c gets 377.91 MFLOPS
   2:ATL_gerk_4x4_1.c gets 377.91 MFLOPS
   3:ATL_gerk_1x4_0.c gets 377.91 MFLOPS
   4:ATL_gerk_8x4_0.c gets 377.91 MFLOPS
DONE L2-BLOCKED TUNING, CHOSE 'ATL_gerk_axpy.c' (377.91)
     M       N     lda  percL1       mflop
======  ======  ======  ======  ==========
  2300    2300    2300     150     377.93
  2300    2300    2300     800     377.91
  2300    2300    2300     450     377.93
  2300    2300    2300     300     377.93
  2300    2300    2300     200     377.91
  2300    2300    2300     250     377.91
  2300    2300    2300     350     377.91
  2300    2300    2300     400     377.91
  2300    2300    2300     600     377.93
  2300    2300    2300     500     377.91
  2300    2300    2300     550     377.91
  2300    2300    2300     700     377.91
  2300    2300    2300     650     377.91
  2300    2300    2300     750     377.93

BEST CASE 150 percent of L1, MFLOP=377.93

BEST L1-blocked kernel:
ID=3 ROUT='ATL_gerk_1x4_0.c' AUTH='R. Clint Whaley' \
   CacheElts=2457 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=1 \
   LDAMUL=0 FYU=0 X87=0 \
   MFLOP=3.779258e+02
BEST L2-blocked kernel:
ID=1 ROUT='ATL_gerk_axpy.c' AUTH='R. Clint Whaley' \
   CacheElts=6144 SSE=0 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=1 XU=16 \
   LDAMUL=0 FYU=0 X87=0 \
   MFLOP=3.779258e+02,3.779123e+02

BEGIN RESTRICTED OUT-OF-CACHE TUNING
   6:ATL_dgerk_4x8_sse.c gets 377.91 MFLOPS
ID=6 ROUT='ATL_dgerk_4x8_sse.c' AUTH='R. Clint Whaley' \
   CacheElts=0 SSE=3 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=16 FYU=0 X87=0 \
   MFLOP=0.000000e+00,0.000000e+00,3.779123e+02

BEGIN RESTRICTED L1-BLOCKED TUNING TUNING
   6:ATL_dgerk_4x8_sse.c gets 377.91 MFLOPS
ID=6 ROUT='ATL_dgerk_4x8_sse.c' AUTH='R. Clint Whaley' \
   CacheElts=2457 SSE=3 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=16 FYU=0 X87=0 \
   MFLOP=3.779123e+02,0.000000e+00,3.779123e+02

BEGIN RESTRICTED in-L1 TUNING TUNING
ID=6 ROUT='ATL_dgerk_4x8_sse.c' AUTH='R. Clint Whaley' \
   CacheElts=2457 SSE=3 alignA=0 alignY=0 alignX=0 minX=0 minY=0 YU=4 XU=8 \
   LDAMUL=16 FYU=0 X87=0 \
   MFLOP=3.779123e+02,0.000000e+00,3.779123e+02,0.000000e+00,inf

BEGIN RESTRICTED in-L2 TUNING TUNING
Segmentation fault (core dumped)

Core was generated by `./xr1ksearch -p d'.
Program terminated with signal 11, Segmentation fault.
#0  0x080490eb in CloneR1Node (dup=0x0) at /usr/include/bits/string3.h:52
52        return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb) bt
#0  0x080490eb in CloneR1Node (dup=0x0) at /usr/include/bits/string3.h:52
#1  0x0804c7a9 in main (nargs=3, args=0xbf9b8d04)
    at /scratch/tmp/portage/sci-libs/blas-atlas-3.9.23/work/ATLAS/gentoo-build/..//tune/blas/ger/r1ksearch.c:629
(gdb) 
From the header:

__extern_always_inline void *
__NTH (memcpy (void *__restrict __dest, __const void *__restrict __src,
               size_t __len))
{
  return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));// LINE 52
}







Comment 16 Ed Catmur 2010-02-21 01:20:09 UTC
The third run of TimeAllKernelsForContext (with imf = 4) returns NULL.

This is because TimeR1Kernel returns -1.2352e+19 (for my system, Intel Core 2 Quad Q2800 @2.33GHz).

Contents of res/dr16_435x8_444_0_a0x0x0 
3 0
-1.235200e+19
-1.235200e+19
inf
Comment 17 Ed Catmur 2010-02-21 01:41:45 UTC
Have to rm res/dr1* before running ./xr1ksearch -p d

Problem appears to be that
./xdr1ktime -m 435 -n 8 -l 444 -C 4192 -Fx 16 -Fy 16 -Fa 16

occasionally returns a negative number e.g. -1.2352e+19 as its median.

e.g.:
# ./xdr1ktime -m 435 -n 8 -l 444 -C 4192 -Fx 16 -Fy 16 -Fa 16
GER1: M=435, N=8, lda=444, AF=[16,16,16], AM=[0,0,0], alpha=1.000000e+00:
   M=435, N=8, lda=444, nreps=186, time=5.370968e-06, mflop=1297.35
   M=435, N=8, lda=444, nreps=186, time=-5.641194e-22, mflop=-12351995227830953984.00
   M=435, N=8, lda=444, nreps=186, time=-5.641194e-22, mflop=-12351995227830953984.00
NSAMPLES=3, MAX=-12351995227830953984.00, MIN=1297.35, AVG=-8234663485220635648.00, MED=-12351995227830953984.00

Something a little wrong, it would seem.
Comment 18 Ed Catmur 2010-02-21 01:47:33 UTC
Ah, it's the time that's the issue:

capella ger # ./xdr1ktime -m 435 -n 8 -l 444 -C 4192 -Fx 16 -Fy 16 -Fa 16
GER1: M=435, N=8, lda=444, AF=[16,16,16], AM=[0,0,0], alpha=1.000000e+00:
   M=435, N=8, lda=444, nreps=186, time=0.000000e+00, mflop=inf
   M=435, N=8, lda=444, nreps=186, time=5.370968e-06, mflop=1297.35
   M=435, N=8, lda=444, nreps=186, time=-5.641194e-22, mflop=-12351995227830953984.00
NSAMPLES=3, MAX=-12351995227830953984.00, MIN=1297.35, AVG=inf, MED=inf

First pass: time=0 (??); second pass: time reasonable (and mflops makes sense); third pass: done in negative time! (half a negative zeptosecond; impressive, given that according to [1] (via [2]) 100 attoseconds is the shortest measured period of time).

1. http://news.bbc.co.uk/2/hi/science/nature/3486160.stm
2. http://en.wikipedia.org/wiki/Zeptosecond
Comment 19 Ed Catmur 2010-02-21 02:20:44 UTC
Problem seems to be that time00 is returning almost-but-not-quite identical doubles before and after the test loop, if it was over quicker than the resolution of time00.  It looks like it's supposed to have a resolution of 2e-4 seconds (kernel tick?).

OK, in this case time00 is ATL_cputime.  We're using the default implementation, which calls getrusage:

   #include <stdlib.h>
   #include <sys/time.h>
   #include <sys/resource.h>
   double ATL_cputime(void)
   {
      struct rusage ruse;
      getrusage(RUSAGE_SELF, &ruse);
      return( (double)(ruse.ru_utime.tv_sec+ruse.ru_utime.tv_usec/1000000.0) );
   }

So... decimal rounding fail, I guess.

Easiest fix would probably be to make r1time coerce time delta to nonnegative.
Comment 20 Ed Catmur 2010-02-21 02:26:17 UTC
Created attachment 220561 [details, diff]
zerotime.patch

Suggested patch.
Comment 21 Markus Dittrich (RETIRED) gentoo-dev 2010-02-26 02:22:42 UTC
(In reply to comment #20)
> Created an attachment (id=220561) [details]
> zerotime.patch
> 
> Suggested patch.
> 

Hi Ed,

Great work, thanks a lot. Would you mind sending this upstream.
I'd like them to have a look to make sure there isn't anything more
fundamental broken in this case.

Thanks,
Markus
Comment 23 Juergen Rose 2010-03-07 22:50:52 UTC
While I could emerge blas-atlas in the last two weeks:

root@thinkpad:/root(38)# genlop -t blas-atlas | tail

     Sun Jan 24 04:20:37 2010 >>> sci-libs/blas-atlas-3.9.21
       merge time: 3 hours, 31 minutes and 6 seconds.

     Sat Feb 13 16:13:07 2010 >>> sci-libs/blas-atlas-3.9.21-r1
       merge time: 3 hours, 43 minutes and 45 seconds.

     Fri Feb 19 15:38:15 2010 >>> sci-libs/blas-atlas-3.9.23
       merge time: 4 hours, 24 minutes and 57 seconds.

Now 'emerge blas-atlas-3.9.23-r1' fails again with the old error:
   BEGIN STAGE 2-3-6: GER TUNE at 22:06
make -f Makefile INSTALL_LOG/zR1SUMM pre=z 2>&1 | ./xatlas_tee INSTALL_LOG/zR1TUNE.LOG
make[2]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/bin'
cd /var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger ; make res/zR1SUMM pre=z
make[3]: Entering directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger'
./xr1ksearch -p z

      Read in L1 Cache size as = 32KB.
make[3]: *** [res/zR1SUMM] Segmentation fault
make[3]: Leaving directory `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger'
make[2]: *** [/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger/res/zR1SUMM] Error 2
Comment 24 Justin Lecher (RETIRED) gentoo-dev 2010-03-07 23:04:26 UTC
(In reply to comment #23)
> While I could emerge blas-atlas in the last two weeks:
> 
> root@thinkpad:/root(38)# genlop -t blas-atlas | tail
> 
>      Sun Jan 24 04:20:37 2010 >>> sci-libs/blas-atlas-3.9.21
>        merge time: 3 hours, 31 minutes and 6 seconds.
> 
>      Sat Feb 13 16:13:07 2010 >>> sci-libs/blas-atlas-3.9.21-r1
>        merge time: 3 hours, 43 minutes and 45 seconds.
> 
>      Fri Feb 19 15:38:15 2010 >>> sci-libs/blas-atlas-3.9.23
>        merge time: 4 hours, 24 minutes and 57 seconds.
> 
> Now 'emerge blas-atlas-3.9.23-r1' fails again with the old error:
>    BEGIN STAGE 2-3-6: GER TUNE at 22:06
> make -f Makefile INSTALL_LOG/zR1SUMM pre=z 2>&1 | ./xatlas_tee
> INSTALL_LOG/zR1TUNE.LOG
> make[2]: Entering directory
> `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/bin'
> cd
> /var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger
> ; make res/zR1SUMM pre=z
> make[3]: Entering directory
> `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger'
> ./xr1ksearch -p z
> 
>       Read in L1 Cache size as = 32KB.
> make[3]: *** [res/zR1SUMM] Segmentation fault
> make[3]: Leaving directory
> `/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger'
> make[2]: ***
> [/var/tmp/portage/sci-libs/blas-atlas-3.9.23-r1/work/ATLAS/gentoo-build/tune/blas/ger/res/zR1SUMM]
> Error 2
> 

Yeah something is totaly screwed up with that version.
Comment 25 Justin Lecher (RETIRED) gentoo-dev 2010-03-07 23:23:43 UTC
Hopefully it is fixed now.
Comment 26 Jiri Pittner 2010-03-08 19:36:34 UTC
I installed now  3.9.23-r1 succesfully.
Jiri
Comment 27 Justin Lecher (RETIRED) gentoo-dev 2010-03-08 20:53:01 UTC
Could we leave this open until we are really sure it works fine?
-r1 has some big changes which aren't as flawless as I would like.
Comment 28 Justin Lecher (RETIRED) gentoo-dev 2010-03-12 07:33:07 UTC
As I am trying to fix the two -r1 ebuild for *-atlas I reemerged the package multiple times. What I observed was, that this segf is randomly in time. So from ten emerges of the same ebuild w/o modifications 3-5 segf. But only on x86 for me.
Comment 29 Daniel M. 2010-04-17 19:58:12 UTC
*** Bug 315769 has been marked as a duplicate of this bug. ***
Comment 30 Daniel M. 2010-04-17 22:18:01 UTC
I can confirm this "random" behaviour (with sci-libs/blas-atlas-3.9.23-r2). After multiple failed attempts, it just managed to build without the segfault.

The only thing I changed was to try to reduce CPU load by shutting down background processes, but I doubt that this is related to the problem.
Comment 31 Jiri Pittner 2010-05-04 09:37:17 UTC
Emerge of 3.9.23-r4 worked in my case on the first attempt, using gcc 4.4.3.
Comment 32 Justin Lecher (RETIRED) gentoo-dev 2013-01-31 11:07:14 UTC
Dropped all atlas packages from tree.
Please use sci-libs/atlas from sci overlay.
If problem still exist with that package, please reopen the bug or file a new one.