Hello,
While compiling and testing SVD routines in LAPack 3.2.1, I came across
a fortran runtime error, which complained about BLAS' s(d)rotm.f files. I used:
(i) gcc<4.5
FC = gfortran
FFLAGS = fboundscheck
(ii) gcc=4.5
FC = gfortran
FFLAGS = fcheck=all
The error message is:
SVD: Testing Singular Value Decomposition routines
./xeigtsts < svd.in > ssvd.out
At line 74 of file srotm.f
Fortran runtime error: Index '2' of dimension 1 of array 'sx' above upper bound
of 1
make: *** [ssvd.out] Error 2
and similar for drotm.f. Apparently, the program performs no bounds check for
the sx(*) array. I think, the situation is similar to something like this:
real::sx(1)
...
if ((.false.).and.(sx(2)>0)) then
...
end if
So, "if" will never work, but the compiler is allowed to evaluate the
condition in the parenthesis, thus sometimes resulting in a segfault, which
would be pretty hard to catch especially in a big application.
I haven't seen similar errors about other BLAS routines, but it does
not mean there aren't any.
Thank you,
Leonid.
PS: I also attach the output from gdb.
 next part 
GNU gdb (GDB) 7.1
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 "i686pclinuxgnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/lisaev/web_buffer/lapack3.2.1/TESTING/xeigtsts...(no debugging symbols
found)...done.
(gdb) r <svd.in
Starting program: /home/lisaev/web_buffer/lapack3.2.1/TESTING/xeigtsts <svd.in
Tests of the Singular Value Decomposition routines
LAPACK VERSION 3.2.1
The following parameter values will be used:
M: 0 0 0 1 1 1 2 2 3 3
3 10 10 16 16 30 30 40 40
N: 0 1 3 0 1 2 0 1 0 1
3 10 16 10 16 30 40 30 40
NB: 1 3 3 3 20
NBMIN: 2 2 2 2 2
NX: 1 0 5 9 1
NS: 2 0 2 2 2
Relative machine underflow is taken to be 0.117549E37
Relative machine overflow is taken to be 0.340282E+39
Relative machine precision is taken to be 0.596046E07
Routines pass computational tests if test ratio is less than 35.00
SBD routines passed the tests of the error exits ( 43 tests done)
SBD routines passed the tests of the error exits ( 43 tests done)
SVD: NB = 1, NBMIN = 2, NX = 1, NRHS = 2
SBD  Real Singular Value Decomposition
Matrix types (see xCHKBD for details):
Diagonal matrices:
1: Zero 5: Clustered entries
2: Identity 6: Large, evenly spaced entries
3: Evenly spaced entries 7: Small, evenly spaced entries
4: Geometrically spaced entries
General matrices:
8: Evenly spaced sing. vals. 12: Small, evenly spaced sing vals
9: Geometrically spaced sing vals 13: Random, O(1) entries
10: Clustered sing. vals. 14: Random, scaled near overflow
11: Large, evenly spaced sing vals 15: Random, scaled near underflow
Test ratios: (B: bidiagonal, S: diagonal, Q, P, U, and V: orthogonal
X: m x nrhs, Y = Q' X, and Z = U' Y)
1: norm( A  Q B P' ) / ( norm(A) max(m,n) ulp )
2: norm( I  Q' Q ) / ( m ulp )
3: norm( I  P' P ) / ( n ulp )
4: norm( B  U S V' ) / ( norm(B) min(m,n) ulp )
5: norm( Y  U Z ) / ( norm(Z) max(min(m,n),k) ulp )
6: norm( I  U' U ) / ( min(m,n) ulp )
7: norm( I  V' V ) / ( min(m,n) ulp )
8: Test ordering of S (0 if nondecreasing, 1/ulp otherwise)
9: norm( S  S2 ) / ( norm(S) ulp ), where S2 is computed
without computing U and V'
10: Sturm sequence test (0 if sing. vals of B within THRESH of S)
11: norm( A  (QU) S (V' P') ) / ( norm(A) max(m,n) ulp )
12: norm( X  (QU) Z ) / ( X max(M,k) ulp )
13: norm( I  (QU)'(QU) ) / ( M ulp )
14: norm( I  (V' P') (P V) ) / ( N ulp )
M= 40, N= 40, type 10, seed=3992,3027,2249, 789, test( 9)= 37.59
SBD: 1 out of 5510 tests failed to pass the threshold
At line 74 of file srotm.f
Fortran runtime error: Index '2' of dimension 1 of array 'sx' above upper bound
of 1
Program exited with code 02.
