LAPACK Archives

[Lapack] Possible bug in BLAS ?rotm.f (and possibly other) subroutines

Hello Leonid,

Thanks for the comprehensive bug report!

I can not find the line you are incriminating in the srotm.f of 3.2.1. 
Line 74 reads:
            W = SX(I)
Are you speaking about this line?

(Note: Julie changed srotm.f with SVN revision r691 to remove the ASSIGN 
statement (see 0023), but I believe, the problem Leonid is describing 
might still be there.)

Best wishes,

On Thu, 6 May 2010, Leonid Isaev wrote:


      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 
(i) gcc<4.5
   FC = gfortran
   FFLAGS = -fbounds-check
(ii) gcc=4.5
    FC = gfortran
    FFLAGS = -fcheck=all
The error message is:

SVD: Testing Singular Value Decomposition routines
./xeigtsts < > ssvd.out
At line 74 of file srotm.f
Fortran runtime error: Index '2' of dimension 1 of array 'sx' above upper 
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:

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,
PS: I also attach the output from gdb.

<Prev in Thread] Current Thread [Next in Thread>

For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or