Package: libatlas3gf-base Version: 3.8.3-29 Severity: normal
I'm getting 'Illegal instruction' from a simple matrix multiply (dgemm), but only for certain size matrices and only on Intel Pentium-4 Prescott (it's actually the Xeon version, Nacona; /proc/cpuinfo below) in a pure Debian amd64 enviroment. Note that Prescott was the first of the Intel Pentium line with x64 support, so I'm guessing some features are missing in this processor that are compiled into libatlas, like maybe SSSE3. I have two other machines with Core-era processors and pure Debian amd64, which do not exhibit this error. In particular multiplication of two 49x49 matrices raises the error, but also two 101x101 and others. (My testing was only square matrices, NxN, and all the values that give the error had N odd. Note that not all N odd caused the error.) A small Fortran program that causes the error is attached, but it was originally encountered in Python & NumPy. In /var/log/syslog, I get kernel: [78730.969065] test_dgemm[30009] trap invalid opcode ip:34698d4a84 sp:7f2a8f377b38 error:0 in libblas.so.3gf.0[3469600000+628000] GDB backtrace: $ gdb ./test_dgemm GNU gdb (GDB) 7.2-debian Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/medlock/tmp/atlas_bug/test_dgemm...done. (gdb) r Starting program: /home/medlock/tmp/atlas_bug/test_dgemm [Thread debugging using libthread_db enabled] [New Thread 0x7ffff7fd8710 (LWP 958)] [New Thread 0x7ffff77d7710 (LWP 959)] [Thread 0x7ffff77d7710 (LWP 959) exited] Program received signal SIGILL, Illegal instruction. [Switching to Thread 0x7ffff7fd8710 (LWP 958)] 0x00000034698d4a84 in ATL_dupKBmm1_1_1_b1 () from /usr/lib/libblas.so.3gf (gdb) bt #0 0x00000034698d4a84 in ATL_dupKBmm1_1_1_b1 () from /usr/lib/libblas.so.3gf #1 0x0000003469913edb in ATL_dpKBmm_b1 () from /usr/lib/libblas.so.3gf #2 0x0000003469913f3c in ATL_dpKBmm () from /usr/lib/libblas.so.3gf #3 0x000000346989f5f5 in ATL_dmmIJK2 () from /usr/lib/libblas.so.3gf #4 0x00000034698a026e in ATL_dmmIJK () from /usr/lib/libblas.so.3gf #5 0x000000346986e810 in ATL_dgemm () from /usr/lib/libblas.so.3gf #6 0x00000034698a7b67 in ATL_dptgemm0 () from /usr/lib/libblas.so.3gf #7 0x0000003e39e068ba in start_thread () from /lib/libpthread.so.0 #8 0x0000003e392cf02d in clone () from /lib/libc.so.6 #9 0x0000000000000000 in ?? () (gdb) $ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 3 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 4 cpu MHz : 2992.731 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 5 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 pbe syscall lm constant_tsc pebs bts pni dtes64 monitor ds_cpl cid xtpr bogomips : 5985.46 clflush size : 64 cache_alignment : 128 address sizes : 36 bits physical, 48 bits virtual power management: [There are 3 more identical processor entires, cut for concision. There are 2 physical processors, which look like 4 due to Hyper-Threading.] -- System Information: Debian Release: 6.0 APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libatlas3gf-base depends on: ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib ii libgcc1 1:4.4.5-10 GCC support library ii libgfortran3 4.4.5-10 Runtime library for GNU Fortran ap libatlas3gf-base recommends no packages. Versions of packages libatlas3gf-base suggests: ii libblas3gf 1.2-8 Basic Linear Algebra Reference imp ii liblapack3gf 3.2.2-1.2 library of linear algebra routines -- no debconf information
c Compile with c gfortran test_dgemm.f -o test_dgemm -lblas -lm -g program test_dgemm integer SIZE parameter (SIZE = 49) double precision A(SIZE, SIZE), B(SIZE, SIZE), C(SIZE, SIZE) c Set A & B to all 1's c and C to all 0's. c I think any values in A & B will cause SIGILL. integer i, j do 10 i = 1, SIZE do 20 j = 1, SIZE A(i, j) = 1. B(i, j) = 1. C(i, j) = 0. 20 continue 10 continue c Compute C = A * B call dgemm('N', 'N', + SIZE, SIZE, SIZE, + 1., + A, SIZE, + B, SIZE, + 0., + C, SIZE) stop end